I have an integration test with cucumber located in src/it directory
how can I run these tests because the JUnit test framework or any other cucumber-scala sbt plugin wants me to define all related stuff in src/test directory
Related
I'm trying to add JUnit5 support in my Eclipse RCP application. It almost works, because for now I can:
Use Maven to build whole application and run tests with Tycho
Run single JUnit5 tests (creating run configuration on specific class) in
Eclipse
Run single JUnit5 tests in Run as JUnit Plug-in test mode in Eclipse
Run multiple JUnit5 tests in Run as JUnit test mode in Eclipse
What I'm trying to achieve now is to be able to run whole sets of test classes in plug-in test mode. For JUnit4-based plug-ins I could simply right-click on whole package or even whole plug-in and invoke Run As -> JUnit Plug-in test.
When I do the same operation on JUnit5 tests I get an error: No tests found with test runner 'JUnit 5'.
My current configuration for such plug-ins looks as follows:
According to official instructions in MANIFEST.FM I have Import-Package dependencies:
org.junit.jupiter.api,
org.junit.jupiter.params,
org.junit.jupiter.params.provider
and org.junit as Require-Bundle dependency
In order to run tests in Eclipse IDE I've also added JUnit 5 library to Java Build Path of the plugin. I coudn't add JUnit 5 runner dependencies to MANIFEST.FM instead, because of conflict with Tycho.
I am trying to merge two modules into single module. Both are successfully running modules. I merge two modules. And trying to run the test cases.
i am compiling source and testcases by using sbt commands:
sbt
clean
compile
project module-read
test:compile
it:test
Till test:compile everything working fine but after it:test, it showing lot of compilation issues.
Could I know best way of compiling?
The test:compile task will only compile tests within the src/test/scala folder as per the default sbt test configuration.
In order to compile your integration tests (in src/it/scala) you will have to run it:compile .
See http://www.scala-sbt.org/0.13.5/docs/Detailed-Topics/Testing.html#integration-tests for more info.
I am trying to run some Unit Tests written for a Mavenized project in Eclipse. The tests run perfectly fine from the command line. They also run perfectly fine if I open up Eclipse and run the tests directly off the POM file (i.e. right click on pom.xml and say run maven tests or whatever).
However, I get the following error when I run the tests as JUnit tests in Eclipse:
java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.test.ESIntegTestCase
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at com.carrotsearch.randomizedtesting.RandomizedRunner$1.run(RandomizedRunner.java:562)
I am using Elasticsearch version 2.1.0. The elasticsearch-2.1.0-tests.jar that contains org.elasticsearch.test.ESIntegTestCase is listed as a dependency in pom.xml and all Maven Dependencies show up in my Eclipse project's build path. I even tried specifically adding the jar to my buildpath and to the run configuration's classpath in Eclipse. Both do not work. Cleaning my project via Project -> Clean... also does not work.
I have C# project. when I analyzed the project the gallio plugin is not executing. It says that,
Gallio won't execute as there are no test projects.
But i have test project. In my pom.xml file test pattern is
<visual.test.project.pattern>*.Tests;*.Test</visual.test.project.pattern>
why this happens?
I have Ncover 3 installed in my system. when i analyze the project with mvn sonar:sonar, I had sets properties as
-Dsonar.gallio.coverage.tool=NCover
-Dsonar.dotnet.test.assemblies="Assembly files"
We have a multi-module Maven setup with a master pom.xml that includes all the others. So mvn test from the root directory runs all our unit tests, with textual output.
I can do Run / Run As / JUnit Test to run a single test class with a graphical test runner.
Question: How do I combine the two, so that I can run all the tests that mvn test runs but with a graphical runner, like the one from Run / Run As / JUnit Test?
Create an eclipse project with all your modules as Maven Dependecies and then create a JUnit Suite which incorporates all tests. Eclipse's JUnit Runner then will execute all declared Tests if you run this suite.
In Eclipse Juno, assuming your project is a Maven Project, you can just right click the project name in the Project Explorer and select Run As ... jUnit test. Alternatively you can produce the same text output you get from mvn test by selecting Run As ... Maven test