MAVEN Integration Test running in two different batches - scala

When I run mvn clean install, all my scala IT run. However, they share parameters each other causing to fail.
I have 2 different folders. If I want to run each folder test suite separately, they work fine, but running all folders together causes a fail.
Is there any way to run in two batches the different tests? I mean, running in one batch all the tests of one folder, and in other batch all the tests of the other folder.

Related

Multi-step, conditional run configuration in Eclipse?

How might I (in a computer science education scenario) create a run configuration in Eclipse, such that there are multiple steps (perhaps this is the Launch Group feature), but where successive steps are only executed if the prior did not fail?
E.g.
Run Checkstyle checker
Compile
Run jUnit tests
Run Jacoco coverage analysis

How can I convince eclipse/JUnit4 to find all my tests, in a gradle/eclipse project?

Background
JUnit 4 test runner, within Eclipse 4.11.
I have an eclipse project that was imported from a build.gradle file. This project has several different source paths, each with their own test path.
main/java, test/java, foo/java, fooTest/java, fooTest/resource, and so on.
Problem
When I run a "whole project" JUnit configuration (debug, run, code coverage, whatever), all it finds are the tests within "test/java". I have successfully added new test classes and new #Test methods within this folder.
Tests from any other source path are ignored when I try to "Run all tests in the selected project, package, or source folder". Furthermore, selecting the specific source folder 'fooTest/java' errors out with the message "No tests found with test runner 'Junit 4'". However, when I use the "Run a single test" option with a specific test class, it finds all its test methods just fine. I can specify a particular method and the test runs just fine.
Stuff that didn't work
I tried changing the output directories of my non-main test source paths to write to the same folder as my working test source path. No joy.
I tried various settings of Eclipse's "Contains test sources" flag for my different test source paths. On or off, the behavior is the same across all my test source paths. /test/java is always found, fooTest/java is always missed. No, I haven't tried all 16 permutations of the flag across my 4 different test source paths.
I tried ripping out all the gradle-related stuff from the .project and .classpath. No change in behavior. Dammit... got my hopes up.
I tried changing the order of the <classpathentry/> in the .classpath project file. When I moved test/java such that it was no longer the first test path, I once again got the "no tests found" error, just like when I aimed the junit configuration "run all tests in the selected project, package, or source folder" at one of my other test source folders. Putting it back restored the original behavior.
Does anyone have further suggestions I could try to make my remaining tests run without individual configurations for every test class that I must manually run one at a time?
I switched to the JUnit 5 test runner, and it picked up on everything just fine. It's vintage package was able to find all my JUnit 4 tests, and I've since modified several tests to use the newfangled annotations and Assertions in JUnit 5.
Perhaps this was a known bug/limitation in the JUnit 4 runner? Ah well. It works now.

KIE Workbench Test Scenarios as a part of Maven build

In my current project we need to run Test Scenarios created in Workbench as a part of a Maven build. The final goal is to have these functional tests included to the continuous integration process.
We spent a couple of days trying to figure it out.
We opened a project that is created by Workbench in the .niogitfolder and are trying to run a maven goal.
But seems that maven goals like mvn clean install or mvn clean verify or mvn clean test don't run the Test Scenarios having a .scenario type at all.
Do you have any ideas on that?
Test scenarios are specific to kie-workbench. maven commands will not execute them during build. If you want tests to be executed during maven build then you have to write junit tests to check the execution of rules and processes.
there is currently work in progress on new version of scenarios in the kie-workbench. See the list of tasks. I would recommend you to bring this requirement there.

How do I run NetBeans JUnit tests from the command line?

I am working on a Java application project in NetBeans. I have added JUnit tests, with the #Test annotation. The tests work fine when I run them from the ‘Run Tests’ menu item.
I want to run the same tests from a command-line script. I do not know how NetBeans does this. I want a single command for testing the whole project. How can I achieve this?
Netbeans uses Ant as a build tool, and its default Ant configuration contains a number of useful targets. You can list them with the command ant -projecthelp (executed in your project directory), which should output, amongst other things,
test Run unit tests.
test-single Run single unit test.
test-single-method Run single unit test.
So, simply executing ant test will run all your unit tests on the command line. This will run the tests, write the test results to the standard output, and finish up with a brief summary (including a BUILD SUCCESSFUL message if all the tests passed, or BUILD FAILED if not).
The ant test command will return an appropriate exit code (0 if all tests passed, 1 if any failed), which can be useful -- for example, if you want to add a pre-commit hook to your version control system to forbid commits with failing unit tests.
You should build your project on the command-line with a build tool like Maven, Ant or Gradle and not rely on Netbeans for building it. Please search for this tools.
You should also consider to read a book about software development like Head First Software Development. They explain why and how to us a build tool (e.g. chapter 6 1/2 of Head First Software Development).

How to do a clean build in eclipse and run a junit test case at startup?

Is there any way we can clean all/rebuild the projects in eclipse and run a jUnit test case every time we open eclipse?
I am developing an eclipse application. The scenario is that i want to schedule UI tests to happen automatically twice everyday. But i do not have an executable build as such. But have the full code base with me and i want to run some scheduled JUnit test cases(based on WindowTester) on it.
Any other ideas that you have is also welcome. :) Thanks in advance.
Ant requires a executable build to perform the tests on it from what i have read. :(
Regards,
Thomas
Tough Jenkins is opensource, Going for jenkins will be a good choice if you have more number of projects to manage. Jenkins dose lot more than automated test case and builds.
But, If you have a small code base and need to peform some specific tasks like
scheduled build and test cases, ant build will is much preferable.
In your case for running test cases,
Create a ant build script to build the entire project (How to write Sample Build scprit)
Create another ant script to read the jars and execute them using the tag (How to write Sample Test Build)
Write a bat file to call the ant scripts and Schedule build twice a day in windows scheduler available in control panel.
SO, this will compile, build your project and test it in scheduled time. Just trigger a mail from the ant script if test fails.