Errors while running Xtext Junit from command line [message #1413361] |
Thu, 28 August 2014 11:03 |
|
Hi,
I have written a DSL and added Junit test case using Xtext Junit by injecting AdInjectorProvider .
When I run from eclipse I am able to run the Test case , but if I run from command line by adding all the required jars in classpath, it gives below error:
1) No implementation for javax.inject.Provider<org.eclipse.emf.ecore.resource.ResourceSet> was bound.
[java] while locating javax.inject.Provider<org.eclipse.emf.ecore.resource.ResourceSet>
[java] for field at com.mydsl.TestMyDsl.resourceSet(TestMyDsl.java:48)
[java] while locating com.mydsl.TestMyDsl
Any Help is really Appreciated.
Cheers
Kunal
[Updated on: Thu, 28 August 2014 11:05] Report message to a moderator
|
|
|
|
Re: Errors while running Xtext Junit from command line [message #1414709 is a reply to message #1414272] |
Mon, 01 September 2014 05:51 |
|
Hi,
I have created a TestRunner Class to run all Xtext Junit Class like below:
public static void main(String[] args) {
Result result = JUnitCore.runClasses(MyDslTestSuite.class);
int totalTestCasesCount = result.getRunCount();
int failureCount = result.getFailureCount();
System.out.println("-------------------------------------------------------------");
System.out.println("Total Test Cases Executed = "+totalTestCasesCount);
System.out.println("Total Test Cases Passed = "+(totalTestCasesCount - failureCount));
System.out.println("Total Test Cases Failed = "+failureCount);
System.out.println("Total Time taken to execute all test cases = "+result.getRunTime() +" milliseconds");
for (Failure failure : result.getFailures()) {
System.out.println(failure.toString());
}
System.out.println("-------------------------------------------------------------");
}
While MyDslTestSuite class contains code to invoke all Junit class.Code looks like below :
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses(
{
TestMyDslXtext.class
}
)
public class MyDslTestSuite {
}
After this, I have added all xtext libraries in classpath and ran TestRunner class from command line using command .
But after I see the the exception that I added in previous post.
Cheers
Kunal
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04343 seconds