|
|
|
|
|
|
|
Re: How to run xtext Junit tests outside eclipse [message #1690165 is a reply to message #1689811] |
Wed, 25 March 2015 14:27 |
Eleanor Richie Messages: 125 Registered: August 2014 |
Senior Member |
|
|
I have been working on the ANT build.xml file and succeeded in compiling the junit tests but I am facing a strange error in the junit target. Here is my junit target and the used paths:
<property name="src.dir" value="src"/>
<path id="junit.class.path">
<pathelement path="${plugins_dir}/org.junit_4.11.0.v201303080030/junit.jar"/>
<!-- <pathelement path="${plugins_dir}/org.hamcrest.core_1.3.0.v201303031735.jar"/>-->
<pathelement path="${plugins_dir}/org.eclipse.emf.common_2.10.1.v20150123-0348.jar"/>
<pathelement path="${plugins_dir}/org.eclipse.emf.ecore_2.10.2.v20150123-0348.jar"/>
<pathelement path="${plugins_dir}/org.eclipse.xtext.junit4_2.8.1.v201503230617.jar"/>
<pathelement path="${plugins_dir}/org.hamcrest.core_1.3.0.v201303031735.jar"/>
<pathelement location="bin"/>
</path>
<target name="runjunit" depends="compile,delete_logs">
<junit printsummary="yes" haltonfailure="no" showoutput="yes" fork="false" >
<test name="my.lang.xtext.LANG.tests.GeneralTestCases" haltonfailure="no" outfile="result">
<formatter type="plain"/>
<formatter type="xml"/>
</test>
<classpath refid="junit.class.path">
<!--<pathelement location="bin"/> -->
</classpath>
</junit>
</target>
In the running of the ANT I got the error of class not found for the Hamcrest plugin so I added it and so other plugins were added as well because they were required. Then the ant gave the below error:
----------------
Type org.eclipse.xtext.junit4.XtextRunner not present
java.lang.TypeNotPresentException: Type org.eclipse.xtext.junit4.XtextRunner not present
at $Proxy4.value(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.eclipse.xtext.junit4.XtextRunner
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.lang.Class.initAnnotationsIfNecessary(Unknown Source)
at java.lang.Class.getAnnotation(Unknown Source)
-------------------
so I added the org.eclipse.xtext.junit4_2.8.1.v201503230617.jar. The strange thing is that in the run it gave the same error of class not found AGAIN for the HAMCREST although it is already in the pathelement!!! Any clue if there is a connection somehow between xtext.junit4 and the hamcrest? or how can I fix the dependency issue?!
[Updated on: Wed, 25 March 2015 14:27] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02647 seconds