Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-jsf-dev] "Workbench has not been created yet." error when running unit test by Ant

David,

Thank you very much for your help and we use "eclipse test framework". Sorry that some build scripts are not checked in yet due to the access right to releng related modules. Hence, you won't be able to point out the problem
by looking at the scripts

I made a copy & paste mistake by calling core-test target for the UI tests. The error is gone after changing ant target to ui-test.

Thanks,
Justin
Oracle

David M Williams wrote:


Assuming you are using the "eclipse test framework" there might be an easy fix ....

in your test.xml file, there's likely a target similar to  that below
Except I bet your's says
target="core-test"?
Having
target="ui-test"
will automatically will start a workbench and run the test
in that context.
Of course ... you could start the workbench yourself, etc., but that's probably making
it harder than it needs to be.

Hope this helps,
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

        <!-- This target defines the tests that need to be run. -->
        <target name="suite">
                <property
                        name="wst-folder"
                        value="${eclipse-home}/wst_folder" />
                <delete
                        dir="${workspace}"
                        quiet="true" />
                <ant
                        target="ui-test"
                        antfile="${library-file}"
                        dir="${eclipse-home}">
                        <property
                                name="data-dir"
                                value="${wst-folder}" />
                        <property
                                name="plugin-name"
                                value="${plugin-name}" />
                        <property
                                name="classname"
value="org.eclipse.wst.sse.ui.tests.SSEUITestSuite" />
                        <property
                                name="plugin-path"
value="${eclipse-home}/plugins/${plugin-name}" />
                </ant>
        </target>






*Justin Chen <yung-chang.chen@xxxxxxxxxx>*
Sent by: wtp-jsf-dev-bounces@xxxxxxxxxxx

01/18/2006 05:01 PM
Please respond to
yung-chang.chen@xxxxxxxxxx; Please respond to
Java Server Faces Tools developer discussion <wtp-jsf-dev@xxxxxxxxxxx>


	
To
	wtp-dev@xxxxxxxxxxx, wtp-jsf-dev@xxxxxxxxxxx
cc
	
Subject
[wtp-jsf-dev] "Workbench has not been created yet." error when running unit test by Ant



	





Sorry for the double posting.

I am running into an error when executing jsf unit test driven by Ant.
It fails at calling PlatformUI.getWorkbench().  I.e., Workbench has not
been created yet and
see the attached error stack at end.

Tried to create a Workbench before calling getWorkbench.
       if(!PlatformUI.isWorkbenchRunning()) {
           PlatformUI.createAndRunWorkbench(PlatformUI.createDisplay(),
new MyWorkbenchAdvisor());
       }

It moved forwarded but again fail to getShell() from the
ActiveWorkBenchWindow.
There are probably more to try.

I am wondering if this is direction to go before I go down to this path
and why this error occurred.

Thank you very much,
Justin
Oracle

-------------------------------------------------
Workbench has not been created yet.| |java.lang.IllegalStateException:
Workbench has not been created yet.
at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92)
at
org.eclipse.wtp.jsf.ui.tests.classpath.JSFLibraryWizardTestCases.testWizardDialog(JSFLibraryWizardTestCases.java:61)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:313)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:199)
at
org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
---------------------------------
_______________________________________________
wtp-jsf-dev mailing list
wtp-jsf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-jsf-dev



Back to the top