Jade Agent using command lines - agents-jade

I am new to Java Agent DEvelopment Framework for developing Agents.
I used to work with Jade using Eclipse, I've created some agents I converted my file to .jar format. But now I want to test my .jar file by creating multiple agents.
How can I create one or multiple Jade agents using a command line ?

Please check the tutorials before asking such questions. Visit the Help Center and read about how to ask good questions.
But nevertheless,To create an agent using command the command line use:
java -cp lib\jade.jar;classes jade.Boot -gui -agents ping1:examples.PingAgent.PingAgent
java jade.Boot -agents "a:agents.AgentClass;b:agents.AgentClass".
Note that the classpath includes JADE classes (lib\jade.jar) and the previously compiled classes of the examples (classes). Note also that the value of the -agents option takes the form:
<agent-local-name>:<fully-qualified-agent-class>
Using JADE terminology, this is called an "Agent Specifier". More than one agent can be started by just typing several agent specifiers separated by a semicolon (';') as in the example below:
java -cp lib\jade.jar;classes jade.Boot -gui -agents ping1:examples.PingAgent.PingAgent;ping2:examples.PingAgent.PingAgent

From the perspective of your personal workflow it is probably not very comfortable to build the jar file each time you want to test your agents. The better way for debugging is to use the eclipse debug capabilities.
For this, place the jade.jar (and other required libraries) in your eclipse project. Further, configure the Java project to include these libraries in your project. After this you should be able to configure a debug configuration, where jade.Boot should be the main class, while the further Jade options (for agents or services) can be placed in the start argument tab (hope this rough description is enough).

Related

Debugging an Erlang code with Makefile in IntelliJ

Setup: OTP 26. IntelliJ 2022.3.1 with plugins Erlang 0.11.1162 and Makefile 223.8214.6
Code under preview: The test suite ct_netconfc_SUITE. We could run it from CLI using the command make common_test_test ARGS="-suite ct_netconfc_SUITE".
Goal: I want to debug test suite ct_netconfc_SUITE.
I have set breakpoints in the code. I have created a configuration using Run-->Edit Configurations for the make command specified above. I tried to debug using Run-->Debug-->Makefile-->Run. It successfully runs the configuration. But it did not stop at the breakpoint.
How to stop at the breakpoint?
Other than IntelliJ, what are the other options to debug an Erlang application with Makefile?
Installed Plugins
Debug Configurations created for the make command
Debugging command
I think you can use io:format function to debug what you want in the code, for example, print out List attribute:
io:format("I_want_to_print_this_List_~p", [List]).
In erlang, not like other programming languages (java, c#, c++) that can add breakpoints in there, with erlang if you have a million processes are running every second and over a hundred functions, that means impossible to add breakpoins to debug one by one.
As the comment of MadScientist, Makefile just helps us stop/start/build... application or which tool or script.

Exploring options to deliver Selenium test to non-tech business team who wish to run the test on their own

Our non-technical business team need to run only 1 automation test script which will be fetching data from several hundreds rows of Excel file. I've created automation that script using a Maven project (with POM framework and Extent Report), using Selenium WebDriver, Java, TestNG, and Eclipse but not sure how to deliver the test/script to the business team. Would appreciate if you guys can suggest a few options to deliver this script to the business team so that they can change few parameters in Excel file and run the script on their own. I'm getting Extent report at the end of the test, would be best if they can get the Extent report as well.
Note: Since they are non-technical, it is preferable to avoid installing and configuring Java, Eclipse, etc tools on their machine but that's not mandatory so I'm open to check several options.
I would like to suggest few options here :
Jenkins - Install it on Any server and share login and url with them. They can execute build and no technical knowledge required.
Executable JAR - Export your project as executable JAR and deliver that JAR file. All they have to do it , Double click on JAR file OR execute via batch file and it should run that script and get done the job. Make sure all data related file should be there with JAR. i.e excel file
Note : They always need JAVA in the machine regardless of what they prefer from above to use.
Usually i used to give as batch file script, if you have jenkins, integrate your bat file in it. other wise share the batch file as it is.
Create a package JAR,
Create .bat file to execute the JAR.

selenium-server-standalone.jar maven dependency

I am using Maven as a build tool. On selniumhq site I can see selenium-server-standalone.jar file but I could not found related Maven dependency. Is there any maven dependency for selenium standalone file?
latest selenium standalone file is : selenium-server-standalone-3.2.0.jar
Note : I want to execute code on Remote desktop machine using Selenium grid (which require aforementioned jar file)
I think you should refer to this manual first: http://www.seleniumhq.org/docs/07_selenium_grid.jsp#starting-selenium-grid
i.e. in order to use grid you need you need to create grid instance first by running commands
from command line, then you need to register node, again by using command line, and after that from your code you need to create instance of RemoteWebDriver (refer to this page for more details: http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#remotewebdriver).
If, for some reason, you want to to create grid\register nodes from your project maybe it makes sense to download it to your resources folder, execute it from there using Runtime (refer to this link for more details: http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html) and then connect to it. But I would strongly recommend avoiding doing so.

Can you run jar files in Pentaho spoon tool?

I want to run a jar file that has java code, inside the Pentaho spoon tool. This run is a single step by accepting an input, running the java class on top of this data and then providing the output somewhere. Is this possible with Pentaho Spoon?
This is very easy. Just pop the jar file into the lib directory with the other jars, and call it from the modified javascript step. ( Or maybe even the java class step if thats more suitable for what you're trying to do )
I've done this several times - most recently for some custom decoding which had to be done in java, and couldnt be done in the java step because janino didnt support it.
A different approach:
leave the jar in your project directly, no copying necessary
create a simple bash script "run.sh" in your project folder with
"java -jar yourjar.jar" in it. you can also add that line directly
within spoon and skip this step
to your job, add a "execute shell script" and point to run.sh
done, the result code of the script determines success or not
why this way? I hate the way the api is documented, no code completion in spoon, Java or Javascript, this way you can write your code outside and rely on working systems

Using Javamail and Gmail

I am looking for a way to send mail using Javamail and the GMAIL SMTP.
Here is a page which provides some code
I have never worked with Public Classes before and also the page suggests that:
To run this example, you need two dependency libraries – javaee.jar
and mail.jar, both are bundle in JavaEE SDK.
Can someone please help me set up this script so that I can bind it to an event such as, OnClick.
Also if wanted to pass variables into the class such as: To, From, Subject, Body, how could I do this?
Please advise....
Thanks
The jars must be in your classpath at compile and runtime for this to work, this is true of any JAVA library (.jar/.zip)
From a command line you would compile with something like
javac -classpath .;path to javaee.jar;path to mail.jar myclass.java
and at runtime
java -classpath .;path to javaee.jar;path to mail.jar myclass
In an eclipse project you would add the mail.jar and javaee.jar to the projects as libraries.
This is pretty basic Java stuff here, I really think you may need to go read up a bit more on this, you will be including libraries as every day java development. There are pleanty of places to find out the fundamentals of this.