RFT and JUnit Related Issue
I was trying to create a Junit Testing framework within an existing RFT framework. The JUnit set up works fine to the point where we don't have to instantiate any framework classes.Whenever we are trying to access framework classes it throws the below exception. I did look for similar issues online but couldn't get a solution.Please suggest a开发者_运维知识库 solution if any body has faced a similar issue. RFT version is 8.1,JUnit version is 4
java.lang.NoClassDefFoundError: com.ibm.rational.test.lt.arm.IArmable
at java.lang.ClassLoader.defineClass(ClassLoader.java:265)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:521)
at java.net.URLClassLoader.access$300(URLClassLoader.java:66)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:985)
I figured it out:
You have to add the jar "com.ibm.rational.test.lt.rftarm_8.2.1.v20120105_1832.jar" to your Java Build Path. Mine was located in C:/Program Files/IBM/IMShared/plugins/. It came with RFT, but appears to not have been included in the Build Path by default.
This looks like a classpath error. If you are invoking JUnit from ANT, Maven, or some similar build tool then make sure you have the appropriate JAR files in the classpath. Remember, some JARS in turn have their own dependencies. Unless all those dependencies are in the classpath you will get the java.lang.NoClassDefFoundError.
If you are trying to run from the GUI client, it might be a little more difficult. Essentially, you will have to add all the dependencies to the jvm's -classpath option.
精彩评论