Can we run Junit5 cases in eclipse mars? - eclipse-mars

Shall we run Junit5 with eclipse-mars
Below are the jars added into build path

Related

Jenkins build without maven

I have a java project which I build and export it as a jar using eclipse. Then I deploy the jar.
Also my project uses dependencies e.g. Apache POI etc. I include these jars in the build path and then clean build and export it as a jar.
I want to build the jar using Jenkins. Please suggest the script and command to perform the same task without using maven. I have to build the code from Gitlab.

Jenkins fails to find SureFire Reports

Jenkins Version : 2.176.2
Executing Selenium tests via Jenkins : Ecplsie+mvn+Jenkins
Selenium Workspace Folder : C:\Users\admin\eclipse-workspace\ACA
The actual location of the testng-results.xml: C:\Users\admin\eclipse-workspace\ACA\target\surefire-reports\testng-results.xml
Jenkins Insatlled / Home Directory: C:\Program Files (x86)\Jenkins
Building in workspace C:\Program Files (x86)\Jenkins\workspace\ACATestAutomationJob
Executing Maven: -B -f C:\Users\admin\eclipse-workspace\ACA\pom.xml clean install
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/target/surefire-reports/testng-results.xml
Did not find any matching files.
How do i make jenkins locate this testng-results.xml?
Thanks,
Raj
Look into Jenkins Console Output, it should report where the build is running (so called WORKSPACE) and where TestNG Results Plugin attempts to locate the results file:
The path to the TestNG results file must be relative to the WORKSPACE and have the syntax of Ant FileSet
If you're uncertain regarding how to properly build the path to the test artifacts - post the full paths to WORKSPACE and the testng-results.xml / emailable-report.html and we will help you to come up with the correct definitions.
In the meantime you could use wildcard paths like:
**/testng-results.xml
so Jenkins will scan its WORKSPACE recursively looking for the testng-results.xml file in all available locations
Your install command also looks suspicious, normally you should not be putting your test artifacts to the Maven repository so you might want to use mvn test or mvn verify instead.
More information:
Turbo Boost Your Digital App Test Automation with Jenkins
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

test-output folder is not created when i execute maven project in jenkins

I have selenium project created using Maven. I have included surefire plugin also . When i execute the "mvn test" command using jenkins . I am not able to see the test-output folder . Could you please help me to fix it
TestNG would create the output folder as test-output only when running it via the IDE such as eclipse or IntelliJ.
When you run TestNG tests via Maven using surefire plugin, then the output folder is controlled by surefire plugin which is passed on to TestNG as part of the initialization.
By default surefire reports are available under target/surefire-reports folder where target folder is the default build output folder.
You can customize or change this folder value via https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#reportsDirectory
After executing test script then
Right click on your project folder into eclipse and click on refresh
button. test-output folder will appear in TestNG

how to run Selenium tests in Jenkins

I want to run my Selenium Webdriver Maven tests in Jenkins. I've followed the tutorial: https://www.guru99.com/maven-jenkins-with-selenium-complete-tutorial.html and https://www.safaribooksonline.com/library/view/jenkins-the-definitive/9781449311155/ch04s06.html
But now, I want to run each of hundreds tests that I've written in Selenium Webdriver with Eclipse.
I use Maven to create testng.xml (where I have my Maven projects to can execute a list of tests in the same execution).
I use Eclipse to write Java to create tests in Selenium Webdriver.
I use github to import tests.
I show you my github project... I don't know how to access into the different folders to execute each testng.xml files, sorry, I'm pretty new here.
Could anybody help me with this issue?
Thanks so much!!!!
Create a freestyle Jenkins job and then go to the configuration page of your job and in Source Code Management section add the URL of your Git repo where you have kept your TestNG tests. This will help to bring the tests from the repository to your workspace.
Then go to the Build section and select Execute windows batch script if and then add the following script:
java -cp ".;/path/to/testng-x.x.x.jar;/path/to/jcommander-x.xx.jar;/path/to/test-classes" org.testng.TestNG /path/to/test.xml
For Linux use the following script with Execute shell in `Build step:
cd /path/to/test.xml
java -cp "/path/to/testng-x.x.x.jar:/path/to/bin" org.testng.TestNG testng.xml
Where /bin folder contains the compiled code for the TestNG tests.
Then save the job and run the build to execute TestNG test cases.
Note: You can find the required JAR files inside the .m2 folder.

How can I build a Netbeans RCP application with SBT?

Netbeans RCP application are built with Ant. How can I build with SBT and integrate in Jenkins?
There's a SBT plugin which allows Ant targets to be called.
First build ant4sbt from sources:
git clone http://github.com/sbt/ant4sbt.git
cd ant4sbt
sbt publish-local
Create a file properties/sbt-ant4sbt.sbt like this:
addSbtPlugin("de.johoop" % "ant4sbt" % "1.1.2")
Create a build.sbt on the root of your Netbeans RCP application:
import de.johoop.ant4sbt.Ant4Sbt._
antSettings
addAntTasks("build-osgi") // creates task antRunBuildOsgi
addAntTasks("run-osgi") // creates task antRunRunOsgi
Now you can build OSGi bundles from command line and run it inside a container, like this:
sbt antRunBuildOsgi
sbt antRunRunOsgi
Building in Jenkins is as easy as calling sbt antRunBuildOsgi but you will have to copy dependencies to the library directory you defined in your Netbeans IDE. After the build you will also have to copy artifacts to the place you distribute artifacts of your builds.
See also: Cannot build OSGi bundle for a Netbeans RCP application

Resources