I want to test hbase using its test cases. I downloaded the project from this link and followed the instruction to test the project, which is simply running the command line
mvn test
There is no problem up to here. What I want to do is to run test cases with jvmti agent. The agent works perfectly fine, I tried it on several java files. Normally, I call my agent to test a java file using
java -agentpath:/path/to/agent/agent.so javaProgram
In this case, the project use maven and I am not good at pom files. I tried to use
alias java="java -agentpath:/path/to/agent/agent.so "
However it did not wok. How can I test hbase with my agent?
You can pass JVM arguments to maven by using the MAVEN_OPTS environment variable:
export MAVEN_OPTS=-agentpath:/path/to/agent.so
A more generic solution is to use JAVA_TOOL_OPTIONS environment variable.
On linux: export JAVA_TOOL_OPTIONS=-agentpath:/path/to/agent.so and then run mvn
Related
I have some doubts about this, first I want to run my java code in a Jenkins pipeline, and my java needs to get 2 folders as arguments from the Jenkins running environment (linux) and then, my java code will do certain comparisons and generate a csv file.
how to run the java code in my Jenkins job? is it simply to get my cloned java code and run mvn clean compile? and how I can send the arguments from jenkins running environment to the java code? and finally how can I let my csv file appear on my Jenkins job dashboard?
Good day everyone.
I have a simple java-based cucumber application, that runs in Docker. I planing to specify which scenarios to run by using ENV for Cucumber tags.
My Dockerfile that able to run specified tags:
FROM maven:3.6.1-jdk-11
COPY target/cucumber-app.jar ./
CMD java -jar -Dcucumber.options='--tags #default' cucumber-app.jar
In this case, during docker run command all works perfectly.
I plan to set up a default scenario for not specified Tags and ability to set up special scenarios through ENV:
FROM maven:3.6.1-jdk-11
COPY target/cucumber-app.jar ./
ENV TAG '--tags #default'
CMD java -jar -Dcucumber.options=$TAG cucumber-app.jar
Unfortunately in this case after running docker container I got:
Error: could not open `default'
Possible you have any ideas why using ENV crash possibility to specify cucumber.options?
If you have a recent version of Cucumber rather then trying to squeeze command line options in through a system property via an environment variable, you can set the environment variable straight away. I.e:
ENV CUCUMBER_FILTER_TAGS '#Cucumber and not (#Gherkin or #Zucchini)'
CMD java -jar cucumber-app.jar
https://github.com/cucumber/cucumber-jvm/tree/main/core
Hello there are tests written on Java + cucumber
The structure is as follows:
https://i.imgur.com/moLVY6L.png
The main question is how to run this tests not from the IDE, say from the console or even wrap it all in jar file
The problems encountered are that you need the main class to create a jar,
It seems as there is a certain java cucumber.api.cli.Main - but how to use it I do not understand. Either way, there's probably a way to run this just from the command line. Please tell us how to do it?
You can download Maven with following terminal script :
$brew install maven
After brew installation, you need to go to the project directory which includes pom.xml file in terminal :
$cd /path/of/your/project
And finally you can run following command to run your tests :
$mvn clean test
You can try the below on command prompt.
java -cp "E:\Workspace\CucumberProj\Jars*;E:\Workspace\CucumberProj\bin" cucumber.api.cli.Main --glue stepDefination E:\Workspace\CucumberProj\Feature\Login_Test.feature
I am using Jenkins, and using a Github repo as Source Code.
In the Build section, I am executing this as a Windows Batch command:
set path=%path%;C:\Program Files\Java\jdk1.8.0_144\bin
cd \Users\harr\JenkinsServer\JenkinsTest\src
javac SimpleTest.java //Error is after this executes
java SimpleTest
I know it has something to do with classpath, but I am unsure how to solve this problem in jenkins.
Let me know if more information would be helpful.
Suppose you deploy the jekins server on linux platform, so you have to install the jdk, tomcat and so on, set the env path as well. Then you don't have to execute set path before every build.
you can create a script and copy the command into it, then when jenkins performs the build task, it can execute the script. Refer to the jenkins tutorial to learn about it.
I am attempting to run end-to-end test for an angular project using protractor and am getting the following error when I run the command 'webdriver-manager start'
I have run webdriver-manager update, and selenium standalone and chromedriver are up to date.
I have java installed. java -version returns
I also have the path to java in my system environment variables (C:\Program Files\Java\jre1.8.0_31\bin)
Does anyone have any idea how to fix this error?
You can also start the web driver as below,
java -Dwebdriver.ie.driver=D:\Selenium_download_New\IEDriverServer.exe -jar D:\Selenium_download_New\selenium-server-standalone-2.45.0.jar
java -Dwebdriver.chrome.driver=D:\Selenium_download_New\chromedriver.exe -jar D:\Selenium_download_New\selenium-server-standalone-2.45.0.jar
Note the Standalone.jar should be placed in the exact location as above, you can also download the standalone.jar from selenium website
I had the same issue. Probably the webdriver update you are running is installing Selenium required files in another folder that it isn't inside your project folder. At least that was my case.
I was using a grunt task for running Protractor tests. If you are using the same plugin check this folder:
C:\{yourprojectfolder}\node_modules\grunt-protractor-runner\node_modules\protractor\selenium
If you don't find that folder then you are under the same issue as me. Try with another bash. You're using cmd, try with Git Bash. Locate yourself in the following directory:
C:\{yourprojectfolder}\node_modules\grunt-protractor-runner\node_modules\protractor\bin
Then run:
webdriver-manager update
Finally check the selenium folder inside your Protractor plugin. It should be created now.
I didn't have time to find why cmd is behaving different than Git Bash when running the same command inside the same folder. Each one installs the Selenium files in different places.
Maybe you are missing a system variable(C:\Windows\System32\ variable.). Adding this variable would solve your problem.
Hope, it helps!
Add "C:\Windows\System32\" to your PATHs.
On windows, right-click My Computer -> Properties -> Advanced system settings -> Environment Variables -> Edit... PATH and add "C:\Windows\System32\" to the end (with a semi-colon separating each variable).
Otherwise
SET PATH=%PATH%;C:\Windows\System32
Then start web driver using below command
webdriver-manager start
SPAWN command is not available in windows.
Install git. git bash will be installed too.
Now add git bash path to the PATH environment variable.
Restart your command prompt and it will run.