Robot - how to check if the execution of a jar is finished - java

I would like to run a jar file using a robot framework test suite, because this test-case is to be included among other test cases.
When the jar is run from the cmd, it produces the expected output, which can take 10 minutes, and then it ends.
My issue is that I'm not capable to detect when the execution of the jar is finished. I tried several keywords combination, in the last attempt I used the keyword Process Should Be Stopped, as shown below, and the result is that the process is always running.
One of my doubts is: which process is running, java? or the execution of the jar?
*** Settings ***
Library Process
Library OperatingSystem
Suite Setup log running on ${properties.hostname}
Suite Teardown Terminate All Processes kill=True
Variables C:/Users/theUser/Desktop/CheckOutRegression/Regression/RegressionScripts/config/properties.py
*** Test Cases ***
Check jar execution
${data}= Start Process java -jar da-1.0-SNAPSHOT.jar importFile1.json importFile2.zip cwd=${properties.pathToScripts} alias=myProc
${wait}= Wait Until Keyword Succeeds 10x 60s Process Should Be Stopped myProc
Log ${wait}
${result}= Get Process Result myProc
Log ${data.stdout}
Do you know how I can check that the execution of the jar file is finished?

Related

Run same jar file sequentially in a loop for different inputs

Am executing a jar file in remote server using jenkins job build step through publish over ssh.
Input build parameters for the job,say list - a,b,c,d,e
Execution command for publish over ssh -
cd /myjarfilepath
for input in $list
do
java -Xmx1024m -cp myApp.jar com.CommandLineRunner $input
done
job fails with error
ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after 120,000 ms]
It runs successfully for one input. Say if it fails for input b then it gets terminated without executing the jar for c,d,e. I want execute the jar for all the inputs available.
Any suggestions will be appreciated!
Thanks.
Yes this is because of default timeout set to=120000. By updating transfers->Advanced->Exec Timeout(ms). I was able to build for all in loop successfully.

Authorization required to install jzos batch launcher?

We are trying to install the JZOS Batch Launcher. The function consists of three pieces: a load module that must be put into a z/OS PDSE, a sample start proc that can be tailored and put into an appropriate PROCLIB, and sample JCL that can be tailored and put into an appropriate SAMPLIB.
On submitting the job we are getting return code=0101. Below are the trace details which we are getting in the job:
Output from DD:STDENV config shell script:
waiting for child shell process to complete
waitChild()
child shell process exited with exit code 0
waitChild()
Child shell process exited without printing environment; //STDENV should not contain 'exit'
adoptEnvironment()
run()
cleanup()
JZOS batch launcher elapsed time=0 seconds, cpu time=0.040000 seconds
JZOS batch launcher failed, return code=101
cleanup()
~JzosVM()
~JzosVM()
After looking this up and reading more,we then tried to run the job with superuser access and the job ran fine. So we need to know what privileges we require without being a superuser which will enable us to run the job successfully.

What is the purpose of OrientDb's port ranges when running an embedded server?

I am running an embedded OrientDb. We're using Spring/Spring Data and we have JUnit tests running via Maven's Surefire plugin.
The embedded database gets started before every test. I'd like to somehow change this so that it would get loaded once per Maven module's execution, if possible.
I had the following:
OServerNetworkListenerConfiguration binaryListener = new OServerNetworkListenerConfiguration();
binaryListener.ipAddress = "0.0.0.0";
binaryListener.portRange = "2424-2430";
binaryListener.protocol = "binary";
binaryListener.socket = "default";
Obviously, due to the amount of tests, 6 ports are insufficient and I get this cryptic error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project bar-api: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /java/foo/bar/bar-api && /java/jdk1.8.0_65/jre/bin/java -Xmx1024m -Xms512m -jar /java/foo/bar/bar-api/target/surefire/surefirebooter3262843936755308263.jar /java/foo/bar/bar-api/target/surefire/surefire2085279380429297504tmp /java/foo/bar/bar-api/target/surefire/surefire_53552629494142788284tmp
There is no System.exit() anywhere in my code, but the Maven Surefire plugin exits the build.
My questions are: why the need for so many ports? Can't it just use one? What am I missing out here and how to fix it? (For the time-being, I have simply increased the number of ports, as a temporary workaround, but I'd really like to get a better understanding of the issue and sort it out properly).
When a server instance starts it tries to bind the listener to the first unused port in that range. So you can't use the same port for two different server instances.

Ctrl-M Filewatcher job invoking a shell script fails

Facing the below error when running the filewatcher job. File that is being watched is already in place.
ctmfw /amex/RSM_1099CTEST.txt CREATE 0 1800 10 3 0 N 0001 2359 NO_MIN_AGE NO_MAX_AGE
/opt/bmc/controlm/cmagentd/ctm/runtime/CMD.0000ctkt_002: line 2:
ctmfw: command not found
Can someone help me identify the cause of this issue.
Thanks in Advance!
The ctmfw command is provided by Control-M/Agent component. You must validate that you are running that Job on a server where a Control-M Agent is installed. In addition, it must be executed with the operating system user under which the agent was installed or, with a user who has execution privileges over the ctmfw utility.

How to analyze ant build output for further decision making?

I'm writing an ant build script to run regression tests for an application. I need to run the test cases sequentially and only if the previous test run was successful. Is there a way I can look a the output of the build to decide if the next target can be called?
[exec] [revBuild] RC = 1
[exec] -------------------------------------------------
[exec] Result: 1
BUILD SUCCESSFUL
Total time: 3 minutes 23 seconds
In the above output, the called application has failed. Is there a way I can search for the application return code in the build output, based on which the next ant target(to run the next test case) can be called?
You probably just want to set the failonerror attribute of the exec task to true. If you do this and the executable's return status code is anything other than 0, then the buildwill fail.
Youi could also store this status code in a property using the resultproperty attribute, and execute some task only if this property is set (or is not set).

Categories

Resources