zrrk / xtext-utils

Automatically exported from code.google.com/p/xtext-utils
0 stars 0 forks source link

Cannot use XtextTest in pde build #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

We are using XtextTest to test our DSL. It works fine in the IDE, but fails on 
our build server. The problem is the @BeforeClass call:
    @BeforeClass
    public static void init_internal() {
        new StandaloneSetup().setPlatformUri("..");
    }

The setPlatformUri("..") is not working on our tycho build because the current 
directory is set to our root build area. Therefore the .. initiate a scan of 
the whole build server projects (!).

Unfortunately, it is not possible to override the init_internal method as it is 
a static method. To workaround the issue, we duplicated the XtestTest class and 
remove the init_internal method.

What steps will reproduce the problem?
1. Create a working XtextTest test case
2. Run a pde build where you do not have the rights to folders next to your 
build area.

What is the expected output? What do you see instead?
1. I expect the test to succeed, instead I got the following stacktrace:
org.eclipse.emf.common.util.WrappedException: Couldn't read 
..\TAP600-WFBD\nm4\nm45\.project
    at org.eclipse.emf.mwe.utils.StandaloneSetup.registerProject(StandaloneSetup.java:244)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:197)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:186)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:186)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:186)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:168)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.setPlatformUri(StandaloneSetup.java:162)
    at org.eclipselabs.xtext.utils.unittesting.XtextTest.init_internal(XtextTest.java:131)
    at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:501)
    at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:259)
    at org.eclipse.test.UITestApplication$2.run(UITestApplication.java:197)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.test.UITestApplication.runApplication(UITestApplication.java:140)
    at org.eclipse.test.UITestApplication.run(UITestApplication.java:62)
    at org.eclipse.test.UITestApplication.start(UITestApplication.java:212)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
    at org.eclipse.core.launcher.Main.main(Main.java:34)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.registerProject(StandaloneSetup.java:231)

What version of the product are you using? On what operating system?
org.eclipselabs.xtext.utils.unittesting_0.9.3.201204261440.jar

Please provide any additional information below.
N/A

Best Regards,
Yann Andenmatten

Original issue reported on code.google.com by yann.nat...@gmail.com on 3 Dec 2012 at 10:46