test « Development « Maven/Ant Q&A

Home
Maven/Ant Q&A
1.Ant
2.artifact
3.dependency
4.deploy
5.Development
6.eclipse
7.glassfish
8.hudson
9.integration
10.jetty
11.junit
12.m2eclipse
13.module
14.netbeans
15.package
16.plugin
17.POM
18.repository
19.svn
Maven/Ant Q&A » Development » test 

1. Sharing Test code in Maven    stackoverflow.com

How can you depend on test code from another module in Maven? Example, I have 2 modules:

  • Base
  • Main
I would like a test case in Main to extend a base test class ...

2. Why does adding a test jar blow up this maven build?    stackoverflow.com

Ok, so I'm getting a little annoyed with Maven 2 right now. The project setup we've got is simple: A "core" project, which is depended on by both a "batch" ...

3. Remove nested test classes with maven2    stackoverflow.com

I use nested classes for accessing private members in JUnit tests. They are alaways named "TestProxy". I would like to remove them at Build time using maven2, to not include it ...

4. How to run individual test in the integration-test target in maven    stackoverflow.com

We have a hundreds of tests defined for our integration-test phase lifecycle in maven, and they take a long time to finish. What I want to do is run just one test ...

5. Using Maven to build separate JAR files for unit testing a custom class loader    stackoverflow.com

As part of my current project I've created a custom class loader. Part of the unit tests for the custom loader involves using some JAR files to demonstrate the proper behavior ...

6. Build Maven Project Without Running Unit Tests    stackoverflow.com

How do you build a Maven project without running unit tests? Currently restructuring some code I have for a Servlet and would like to try it out in my web browser (which ...

7. Run a single test method with maven    stackoverflow.com

I know you can run all the tests in a certain class using: mvn test -Dtest=classname But I want to run an individual method and -Dtest=classname.methodname doesn't seem to work. Thanks -Bill

8. Maven - Skip building test classes    stackoverflow.com

Is there a simple way to not build the test classes?

mvn clean install -Dmaven.test.skip=true
Walter

9. Maven2 compiles my tests, but doesn't run them    stackoverflow.com

I have a simple Maven2 project with tests written for TestNG. When I say mvn test Maven2 compiles my test, but don't run them. I already checked this page:

10. Adding java source (.java files) to test jar in Maven    stackoverflow.com

I'm making use of my pom.xml and am was able to generate the jar for src/main/java (say app.jar) as well as for src/test/java (say app-test.jar). I was also able to include ...

11. Can I run a specific testng test group via maven?    stackoverflow.com

I have several testng test groups, e.g. group1,group2,group3... These are defined in my pom.xml and all get run when I execute "mvn test". What do I need to run to only ...

12. Common test data for multiple independent maven projects    stackoverflow.com

I have a maven project that converts text files of a specific format to another format. For testing I have put in src/test/resources a large amount of test files. I also have ...

13. maven test cannot load cross-module resources/properties?    stackoverflow.com

I have a maven mantained project with some modules . One module contains one XML file and one parsing class. Second module depends on the first module. There is a class that calls the ...

14. What is a good tool for unit testing javascript in a maven webapp / liftweb project?    stackoverflow.com

I want to unit test the javascript I have embedded in the webapp portion of my liftweb project. Liftweb is a subset of the maven webapp archetype, so my question ...

15. how to integrate TODO handling into the maven test phase?    stackoverflow.com

suppose i have a project with lots of todos, some unintentionally left there, some no longer relevant, some represent future possible features etc. i know that most IDEs can show/filter/sort them, but ...

16. Running test from Maven fails and stops building the jar    stackoverflow.com

I am trying to build a jar using maven , this jar was build using ant. When I run tests from maven I got an:

ERROR org.hibernate.tool.hbm2ddl.SchemaValidator could not complete schema validation 
org.apache.commons.dbcp.SQLNestedException: ...

17. How to build a jar using maven, ignoring test results?    stackoverflow.com

Actuality when i run tests they fails but i need to run them to get some .class files which are very important for my jar. By default when test results fails , ...

18. How can I test command-line applications using maven?    stackoverflow.com

I work on a complex, multi-module maven project. One of the modules is an executable jar that implements a command-line application. I need to integration test this application. I need to ...

19. Maven doesn't see tested classes    stackoverflow.com

i have problem with maven. When i try to compile test classes (mvn test-compile), it fails to find the tested classes used in test classes. For example class UserTest can't be ...

20. maven-assembly-plugin causing tests to run twice    stackoverflow.com

I have a maven project where I am using the assembly plugin. I typically create my artifacts by running: mvn clean verify assembly:assembly (I have integration tests which I want run separately to ...

21. How do i run a single class from the test folder of Maven from the command line?    stackoverflow.com

i'm trying to run a number of classes which reside in the Maven 'test' folder from the command line which i will later combine to run in a ksh script. The issue ...

22. How to instruct Maven to ignore my main/resources/persistence.xml in favor of test/...?    stackoverflow.com

I have two persistence.xml files, for the sake of testing:

  • src/main/resources/META-INF/persistence.xml
  • src/test/resources/META-INF/persistence.xml
How to instruct Maven to ignore the first file during testing? Now it is not ignored since OpenEJB says:
ERROR - FAIL ... ...

23. Why Maven is running tests again, when JAR is already there?    stackoverflow.com

I install my maven project:

mvn clean install
Everything works fine, JAR file is created in /target directory. Now I run it again:
mvn install
Maven executes unit tests and static code analysis again. I ...

24. How to skip tests when using maven reactor?    stackoverflow.com

I am working on a Maven multi-modules project. I want to build a given module and skip the unit tests to speed the process up. I've tried the following: mvn reactor:make -Dmake.folders=search -Dgoals=package,-DskipTests mvn ...

25. Invoke tests classes from another Maven project    stackoverflow.com

I have 2 maven projects, one for the sources: ProjSource, containing one class: Class-A.. and another one: ProjTest containing a test class for Class-A named Class-A-Test . I want my test class ...

26. Publish test utils from maven project    stackoverflow.com

I created a library in maven that can be extended by implementing some interfaces. To test the default implementation I have written some hamcrest matchers that currently live in src/test/java. However, I ...

27. Can I run all the TestNG tests that do not belong to any group (in Maven)?    stackoverflow.com

Or in alternative formulation: Are tests in TestNG assigned to a default group if no group is specified, and if yes, what is the name of that default group? (Yes, I have ...

28. Seperating tests from src with Maven Project?    stackoverflow.com

I've just started working on a Java project (as I usually use .net), and one of the first things that strikes me as odd is that in the Maven project there ...

29. how to configure to allow a lib can be used both in src and test?    stackoverflow.com

i want my lib can be used by both in src and test class. there is a scope properties... should i do something with it? thanks?

<dependency>
        ...

30. Maven Project Testing Problem    stackoverflow.com

i am using maven i don't have more knowledge about maven when i am install my project then it will successfully build but when i am test my project with ...

31. How do i run JBehave tests with Maven?    stackoverflow.com

How do i run JBehave tests from Maven? I have a class that extends JUnitStories which runs from my IDE. I cant get JBehave Maven plugin to run my tests. Can anyone point to ...

32. Unit tests for a service-provider interface in Maven    stackoverflow.com

Greetings, Recently our dev team has moved from Ant build files to Maven for our project management and build cycle. So far I'm really happy with the results. Since I'm still getting ...

33. Is there some settings in Maven or Bamboo to restrict the tests to run in the same JVM as Bamboo rather than running in a seperate JVM?    stackoverflow.com

I use Bamboo and Maven for continuous integration and running tests. Where ever scheduled/dependent maven tests run in Bamboo, it creates a new JVM. I have a huge no. of test ...

34. TestNG parallel tests failing    stackoverflow.com

First let me put out the structure of my tests:

  • There is BaseTest(Singleton) containing a setUp() method which runs @BeforeSuite. This setUp() method initializes MyObject which is declared as:
protected static ThreadLocal<MyObject> ...

35. maven 3 webapp - No tests to run?    stackoverflow.com

I've created a webapp with maven 3:

 mvn archetype:generate -DgroupId=com.my.app -DartifactId=myweb-app -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
I didn't get the src/test/java folder, so I added it. As I understand, this doesn't violate the ...

36. Alternate SLF4J Binding or Config For Unit Test?    stackoverflow.com

I'd like to be able to switch the bindings for SLF4J for unit testing over to the simple version, but it seems there is no easy way to config this. Basically, ...

37. Multiple test sets in Maven    stackoverflow.com

I have written a REST server (in Java using RestEasy) with a unit test suite written in Scala. The test suite uses the mock server provided by RestEasy and ...

38. Pick up native JNI files in Maven test (lwjgl)    stackoverflow.com

I'm creating a program with LWJGL and Maven, and I'm writing unit tests for the graphical code. My problem is getting Maven to put the native binaries on the classpath ...

39. How can I make a maven test dependent on a class defined in another project's test?    stackoverflow.com

I have two projects, A, and B. Project A depends on project B. Project B implements several JUnit tests that run properly with maven test. Project B JUnit tests also define ...

40. How to manage development, production, testing configuraions with maven?    stackoverflow.com

I'm new to maven and coming from a rails background. At a high level, I want to connect to a different database if I'm running tests, running the app locally, and ...

41. jaxws-maven-plugin wsgen on test endpoint    stackoverflow.com

I'm trying to get maven 3 to run wsgen against two web service endpoints. One is a 'production' endpoint, located under src/main/java, and the other is a 'test' endpoint that is ...

42. Maven test does not complete    stackoverflow.com

When i run a mvn test Maven runs all the tests successfully and then goes on a wait infinite loop I see a java process in the task manager ...

43. How to run Test unit with VM option    stackoverflow.com

Currently I am doing java project using Maven. There is no problem to run using netbeans or eclips with VM option(-Djava.security.policy=security_policy.txt ) setting in the IDE. But now i want to run ...

44. can we have bash tests in maven build process for java?    stackoverflow.com

If my main logic is written using java (a small daemon server), but my test cases is a bash script. How can I include the test into my maven pom.xml? so ...

45. Problem with maven test    stackoverflow.com

I have maven project X which depends on project Y. when I run the tests on project X, it is not able to find the test files in project Y although ...

46. null pointer exception while executing test with testng    stackoverflow.com

// i am trying to execute test cases by grouping them using testng

         ...

47. Maven an java.io.scanner(System.in)    stackoverflow.com

I'm running into issues with my project. When running in Netbeans it seems to work fine with user interaction. However when I run using mvn test it does not. I see ...

48. maven 1 fails when running test    stackoverflow.com

I've changed the junit version from 3.8 to 4.4 in the application use maven 1. For that I change the project.xml, now look like this:

...
<dependency>
    <groupId>junit</groupId>
   ...

49. Pax Exam Maven project and issues with Black/Grey/White-box testing    stackoverflow.com

Pax Exam gives a great deal of flexibility when testing a set of bundles, but as far as I understand it seems that, in a Maven project, black-box testing is not ...

50. How to read configuration files in a unit test?    stackoverflow.com

I have a standard maven project layout.
Some configuration files are stored in src/main/conf.
Now I would like to read these files in my unit test in src/test (e.g. read a properties from ...

51. Running unit tests before building stage in multi-module maven project    stackoverflow.com

I have a multi-module maven project. In every module there are unit tests. When I make clean install tests run before every module and if all tests in one module are ...

52. Using Maven, how do I run specific tests?    stackoverflow.com

I have thousands of unit tests in my project, and I'd like to choose one or a couple of them to run from the command line. What's the command to do ...

53. How to deal with uncompilable source code in web app projects that need to be deployed for testing?    stackoverflow.com

I have a web app project under development using Maven 2 that I want to deploy on server to be able to view the webpages for testing purposes while developing. Howver ...

54. How to tell Emma which test classes to use in a maven project    stackoverflow.com


I have two sort of tests in my project. One of them is ending "Test", the other is ending with "IT".
How can i tell emma that it should take all ...

55. JBehave & Maven - how to skip scenario tests    stackoverflow.com

I'm using jbehave and the jbehave maven plugin to run a set of scenario tests. Have my test class extending JUnitStories, and everything works nicely. Only issue is, I can't stop running ...

56. QA/Tests and Maven?    stackoverflow.com

I have a simple question about how to use Maven in enterprise process. After a release, my artifacts are deployed to our internal repository. Now, QA needs to start testing the ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.