Jmeter - how to implement another java class - java

Greetings all,
In another post I asked about rendering PDF in Jmeter, and it would seem the solution is to use iText.
Using iText requires installing another library and referencing it. Does anyone know how to do this? I can't find a tutorial. Much thanks. iText is also dependent upon bouncycastle
iText: http://www.1t3xt.com/downloads/index.php
iText dependency: http://www.bouncycastle.org/latest_releases.html

You just need to add it to your classpath when running JMeter. Unfortunately in the jmeter.bat or jmeter.sh they run JMeter using the -jar flag which will ignore your custom classpath. To get around this you need to simply include the ApacheJMeter jar in your class path and run the class org.apache.jmeter.NewDriver as your starting class.

Related

How to setup allure for selenium +TestNG+java project?

I used extent report with java selenium for the automation testing but I would like to try allure reporting. Can anyone please explain to me how to setup Allure+ TestNG+ selenium in eclipse for automation?
Does it supports only maven based projects or even for java projects as well we can do it? Thanks
There is no pom.xml file in my current java project ...so this is a doubt if I can implement
It's fairly simple. If you don't have a pom that means you are possibly using ant to build your tests. That's not an issue. What you can do is, download the allure .jar file. Add it to your project and off you go. With allure, there is no setup required. You will, however, need to implement annotations in your classes where you would like allure yo log things.
Here is an example :
Allure will then log your tests and steps as you would suspect natively. If you want screenshots and all the other goodies you would need to implement it. The docs can help with this part.
Here is the link to the jar file for allure - https://jar-download.com/artifact-search/allure-testng
Have a nice day!
If you are not using pom, then based on latest version which is available at the time you need following JAR files to be added in build path of your project in eclipse .
In my example I would be using version 2.9.0
allure-testng-2.9.0.jar
allure-model-2.9.0.jar
allure-java-commons-2.9.0.jar
allure-descriptions-javadoc-2.9.0.jar
sl4j-api-1.x.x.jar
Finally you need allure-commandline-2.9.0.zip .choose same version which you have downloaded above files.
Extract and set the path as described in the link -https://docs.qameta.io/allure/#_manual_installation
Hope It helps! Thanks

How to Create, mount , unmount VHD's through java program on windows server 2008?

With reference to VHD Java library , I tried to use libguestfs.. but I am unable to get it work. At the first glance it seems that it is not working on the windows environment.
But for the try I am stuck at first point only, how to get jar file for com.redhat.et.libguestfs.* classes. I might be wrong in my execution plan.. kindly help.
Is there any better way to achieve my goal of creating , mounting , unmounting VHD's through java program.
Thanks in advance...
The Java bindings, which contain the com.redhat.et.libguestfs package, are available as part of the source distribution tarball. This can be obtained from the libguestfs download page; select the latest version, currently 1.18.8.
Alternatively, a pre-compiled JAR might be available from the Maven repository.
Either way, on Windows you likely have to compile the native libguestfs library yourself.

how to generate coverage.xml in jmockit?

I am using Jmockit for my unit tests and I have also included jmockit-coverage.jar in my classpath. Currently it generates the following files under 'coverage-reports' folder:coverage.css,coverage.js,index.html,logo.png,prettify.js
But its not generating coverage.xml. According to the document here - http://jmockit.googlecode.com/svn-history/r289/trunk/www/tutorial/CodeCoverage.html, I think I need to add 'jmockit-coverage-xmlfull.jar' in my class path. But I am not able to find that jar online. Its not available in jmockit download link.
Could you please let me know how to fix this issue?
Thanks,
Suresh
This link seems to be an older one showing an older svn revision number (r289). The latest one lies here http://jmockit.googlecode.com/svn-history/trunk/www/tutorial/CodeCoverage.html#output. Looks like it supports html as of now, but could not find xml. Basically the jmockit-coverage-output property is used to decide the output.
If you really need the xml version, you might need to download an older version which has all the jars. Try this link.
https://jmockit.googlecode.com/files/jmockit-0.993.zip

Implement Growl in Java Application

I want my Java application to make a growl notification. My IDEs are Eclipse and Netbeans, and I am trying to implement a library in either (so far it worked it neither). How can I just add the library to my project and then reference the classes from within my own classes? Moreover, where can I find an appropriate library?
Thanks in advance!
EDIT: Ok, now I have somehow managed to implement the library ^^ However: the following command fails:
System.loadLibrary("growl");
It returns following error:
Message: no growl in java.library.path
How can I fix this?
About an appropriate library you should just google it. I found this one (that is tested on 10.5 so maybe it will need some tweaks): http://www.cocoaforge.com/viewtopic.php?f=6&t=17320
To add the library to your project in Eclipse copy it into the project folder (this is not necessary, you could just copy it wherever you want, also in extension folder of the JDK) and then add it through the project settings:
open project properties by right clicking the project and choosing Properties
go to Java Build Path option
go to Libraries and add it
It's possible to use AppleScript script engine in Java 6 on OS X to communicate with Growl. Here's a blog post describing how to do it.
You can use the network binding like in https://github.com/chamerling/JavaGrowl or https://github.com/aerofs/growljavabindings
Maybe this can help you.
If your classes are packaged in a JAR file, just like a 3rd party library, you should be able to put it in your project /lib directory and add it to the CLASSPATH using the IDE. That should be all you have to do (if I understand your question correctly).

Java based Atom/RSS Library that works in Google App Engine

I am trying to publish an Atom/RSS feed in my Java based Google App Engine code. I have tried using Rome and keep getting the following error (tried googling without success), also the code I am running that generates the error is the demo code (so I get the feeling Rome won't work with GAE)
java.lang.NoClassDefFoundError: org/jdom/JDOMException
at com.sun.syndication.io.SyndFeedOutput.<init>(SyndFeedOutput.java:44)
What I am looking for is recommendations for a simple Java library to create and publish an Atom feed from within Google App Engine.
Thanks.
java.lang.NoClassDefFoundError: org/jdom/JDOMException
This just means that the particular class is missing in the runtime classpath (while it was available in the compiletime classpath, that's the difference with ClassNotFoundException).
Logical next step would be to include the particular class (or more actually, the JAR file with the particular class) in the runtime classpath. Then this error wil gone.
Check your compiletime classpath if it is there and add it to runtime classpath. Or if it is actually a dependency which you don't have yet, then it's good to know that the package name already hints that you could find and download it at http://jdom.org.
#Adriana and any other people late to the thread:
What Balus meant was that the original poster, was missing the JDOM library, which can be downloaded at http://jdom.org/. You just need to add the .jar to the classpath, which the ROME demo code apparently was lacking.

Categories

Resources