testing webapp with surefire

View: New views
2 Messages — Rating Filter:   Alert me  

testing webapp with surefire

by Pablo-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there

I'm trying to perform several tests (StrutsTestCase) on my web
application using M2.
The StrutsTestCase requires /WEB-INF/web.xml to be in the classpath.
When tests are run in a default way m2 says: The /WEB-INF/web.xml was
not found.
I've found one configuration parameter called "|classpathElements|" to
be helpful (as its name suggests).
However when I add this to the configuration:
<plugin>
  <configuration>
    ..
          <classpathElements>
            <classpathElement>src/webapp</classpathElement>
          </classpathElements>
    ..
  </configuration>
</plugin>
M2 writes the following message:

[INFO] Error configuring:
org.apache.maven.plugins:maven-surefire-plugin. Reason: ERROR: Cannot
override read-only parameter: classpathElements in goal: surefire:test

Therefore I have a question. What should I set in pom.xml file to make
StrutsTestCase's tests work?

Thanks in advance
Cheers
Pablo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: testing webapp with surefire

by Brett Porter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think it is necessary to:
a) file a request for an "additionalClasspathElements" field for the
plugin, and/or,
b) copy the file(s) to target/test-classes

- Brett

On 11/9/05, Pablo <pablo@...> wrote:

> Hi there
>
> I'm trying to perform several tests (StrutsTestCase) on my web
> application using M2.
> The StrutsTestCase requires /WEB-INF/web.xml to be in the classpath.
> When tests are run in a default way m2 says: The /WEB-INF/web.xml was
> not found.
> I've found one configuration parameter called "|classpathElements|" to
> be helpful (as its name suggests).
> However when I add this to the configuration:
> <plugin>
>   <configuration>
>     ..
>           <classpathElements>
>             <classpathElement>src/webapp</classpathElement>
>           </classpathElements>
>     ..
>   </configuration>
> </plugin>
> M2 writes the following message:
>
> [INFO] Error configuring:
> org.apache.maven.plugins:maven-surefire-plugin. Reason: ERROR: Cannot
> override read-only parameter: classpathElements in goal: surefire:test
>
> Therefore I have a question. What should I set in pom.xml file to make
> StrutsTestCase's tests work?
>
> Thanks in advance
> Cheers
> Pablo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...