You are great and I will remember you when I'm rich and famous.  When I
switched the dependency to "jwebunit-core" from "jwebunit-htmlunit-plugin"
the compilation errors went away and my unit test ran.

As a bonus, do you know where the output of the tests gets saved to?  All
I'm told is that my unit test failed.

Thanks, - Dave


cho:webapp dalvarado$ maven -Dtestcase=test.AddToMailingListTest test:single 
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.1

Trying to get missing dependencies (and updated snapshots) required by
colorado-oit-governor-citizen-assistanceUtility-webapp:
- Attempting to download net.sourceforge.jwebunit:jwebunit-core:1.4:jar from
http://software.ais.pl/repository
- Attempting to download net.sourceforge.jwebunit:jwebunit-core:1.4:jar from
http://download.java.net/maven/1/
- Attempting to download net.sourceforge.jwebunit:jwebunit-core:1.4:jar from
http://repo1.maven.org/maven
41K downloaded
build:start:

test:single:
java:prepare-filesystem:

java:init:

java:compile:
    [echo] Compiling to
/Users/dalvarado/source/assistanceUtility/webapp/target/classes
    [echo] 
==========================================================

  WARNING:  maven.compile.target is not set:
            using the default value which depends on your JVM

==========================================================
          

java:jar-resources:

test:prepare-filesystem:

test:test-resources:

test:compile:
    [javac] Compiling 1 source file to
/Users/dalvarado/source/assistanceUtility/webapp/target/test-classes

    [junit] dir attribute ignored if running in the same VM
    [junit] Running test.AddToMailingListTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.039 sec
-------------------------------------------------------------------------------
>> Unable to obtain goal [test:single]
>> Test test.AddToMailingListTest failed
-------------------------------------------------------------------------------
BUILD FAILED
-------------------------------------------------------------------------------
Total time   : 8 seconds 
Finished at  : Monday, October 5, 2009 7:26:43 AM MDT
Final Memory : 5M/16M
-------------------------------------------------------------------------------






Lukas Theussl-4 wrote:
> 
> 
> Even your second mail is not specific enough to help us help you in any
> meaningful
> way. You might profit from reading this:
> 
> http://catb.org/~esr/faqs/smart-questions.html
> 
> As a first guess I'd like to know if jwebunit-htmlunit-plugin is the only
> jwebunit
> dependency you added in your pom? If yes it would explain (some of) the
> compilation errors, eg junit.WebTestCase is in jwebunit-core, not
> jwebunit-htmlunit-plugin. But that's just a guess...
> 
> HTH,
> -Lukas
> 
> 
> laredotornado wrote:
>> Yes, I should have been more specific.  Here's how I'm making the call
>> ...
>> 
>> maven -Dtestcase=test.AddToMailingListTest test:single 
>> 
>> and what happens is that I'm getting a bunch of compilation errors, even
>> though the libraries in question are listed as a dependency in my
>> project.xml file (I have confirmed the jars are getting downloaded) ...
>> 
>> maven -Dtestcase=test.AddToMailingListTest test:single
>> __ __
>> | \/ |__ _Apache__ ___
>> | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
>> |_| |_\__,_|\_/\___|_||_| v. 1.1
>> 
>> build:start:
>> 
>> test:single:
>> java:prepare-filesystem:
>> 
>> java:init:
>> 
>> java:compile:
>> [echo] Compiling to
>> /Users/dalvarado/source/assistanceUtility/webapp/target/classes
>> [echo]
>> ==========================================================
>> 
>> WARNING: maven.compile.target is not set:
>> using the default value which depends on your JVM
>> 
>> ==========================================================
>> 
>> 
>> java:jar-resources:
>> 
>> test:prepare-filesystem:
>> 
>> test:test-resources:
>> 
>> test:compile:
>> [javac] Compiling 1 source file to
>> /Users/dalvarado/source/assistanceUtility/webapp/target/test-classes
>> [javac]
>> /Users/dalvarado/source/assistanceUtility/webapp/src/test/java/AddToMailingListTest.java:9:
>> package net.sourceforge.jwebunit.junit does not exist
>> [javac] import net.sourceforge.jwebunit.junit.WebTestCase;
>> [javac] ^
>> [javac]
>> /Users/dalvarado/source/assistanceUtility/webapp/src/test/java/AddToMailingListTest.java:11:
>> cannot find symbol
>> [javac] symbol: class WebTestCase
>> [javac] public class AddToMailingListTest extends WebTestCase {
>> [javac] ^
>> [javac]
>> /Users/dalvarado/source/assistanceUtility/webapp/src/test/java/AddToMailingListTest.java:28:
>> cannot find symbol
>> [javac] symbol : variable super
>> [javac] location: class test.AddToMailingListTest
>> [javac] super.setUp();
>> [javac] ^
>> [javac]
>> /Users/dalvarado/source/assistanceUtility/webapp/src/test/java/AddToMailingListTest.java:30:
>> cannot find symbol
>> [javac] symbol : method getTestContext()
>> [javac] location: class test.AddToMailingListTest
>> [javac]
>> getTestContext().setBaseUrl("http://localhost:8080/apps/oit/governor/citizen/assistanceUtility";);
>> [javac] ^ 
>> 
>> Thanks, - Dave
>> 
>> 
>> 
>> 
>> 
>> Neroon wrote:
>>> Hi Dave,
>>>
>>> could you give some detail on what the exact error is and on how you
>>> actually 
>>> call 'test:single'?
>>>
>>> Maven takes care of your test classpath, so to my knowledge you don't
>>> need
>>> to 
>>> set 'maven.test.classpath' if you have everything you need declared as a 
>>> dependency. At least I never had to.
>>>
>>> I assume that your unit tests work without any issue when executing
>>> 'maven 
>>> test:test' since you not explicitly mentioned it. So the problem
>>> probably
>>> is 
>>> with the call for the 'test:single' goal.
>>> Unlike Maven2 where you give only the name of the test class to the
>>> Surefire 
>>> plugin when you want to execute a single unit test, for Maven1 you need
>>> to 
>>> specify the fully qualified class name. Would look something like this:
>>> maven test:single -Dtestcase=com.somecompany.someproduct.stuff.TestCase
>>>
>>> Cheers,
>>> Siegfried
>>>
>>> Am Freitag, 2. Oktober 2009 schrieb laredotornado:
>>>> Hi,
>>>>
>>>> I'm using Maven 1.1 with maven-test-plugin-1.8.2.jar.  When I run the
>>>> "test:single" target with my test class, I get a bunch of compilation
>>>> errors
>>>> (all related to jwebunit), despite the fact I have this dependency in
>>>> my
>>>> project.xml ...
>>>>
>>>>         <dependency>
>>>>             <groupId>net.sourceforge.jwebunit</groupId>
>>>>             <artifactId>jwebunit-htmlunit-plugin</artifactId>
>>>>             <version>1.4</version>
>>>>         </dependency>
>>>>
>>>> I read somewhere that I'm supposed to set this property ...
>>>>
>>>> maven.test.classpath
>>>>
>>>> when using the maven test plugin.  Although I put this property and the
>>>> associated jars in my project.properties file, I still get compilation
>>>> errors.  Any ideas how to proceed from here? - Dave
>>>>
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/Trouble-running-Maven-
>>> test-case-tp25722078p25722078.html
>>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Trouble-running-Maven-test-case-tp25722078p25750887.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to