Install Xvfb and start it before runing your tests.

Xvfb  is an X server that can run on machines with no display hardware and
no physical input devices.  It emulates a dumb framebuffer using virtual
memory.

So you can do this from a shell script

# Start the xserver
Xvfb :5 >/dev/null 2>&1 &
proc=$!
# Run your tests
ant run-test
# Kill the xserver
kill -TERM $proc



On Fri, Oct 17, 2008 at 5:33 PM, Arthur Kalmenson <[EMAIL PROTECTED]>wrote:

> Hello everyone,
>
> I'm trying to run some GWTTestCases on our Continuous Integration server
> but it fails because the server is in run level 3, i.e. X isn't running.
> When I ssh into the box with X forwarding, the test cases pass, but without
> X forwarding they fail with error messages. Here's the script that's run by
> Hudson:
>
> #!/bin/bash
>
> export
> CLASSPATH="/home/sysadm/.m2/repository/com/google/gwt/gwt-user/1.5.2/gwt-user-1.5.2.jar":"/home/sysadm/.m2/repository/com/google/gwt/gwt-dev/1.5.2/gwt-dev-1.5.2-linux.jar":"/home/sysadm/credentialing-msh/src/main/java":"/home/sysadm/credentialing-msh/src/main/resources":"/home/sysadm/credentialing-msh/classes":"/home/sysadm/credentialing-msh/target/test-classes":"/home/sysadm/credentialing-msh/target/classes":"/home/sysadm/.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar":"/home/sysadm/.m2/repository/junit/junit/4.1/junit-4.1.jar":"/home/sysadm/credentialing-msh/src/test/java":"/home/sysadm/credentialing-msh/src/test/resources":"/home/sysadm/credentialing-msh/target/test-classes":"/home/sysadm/credentialing-msh/target/classes":"/home/sysadm/.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar":"/home/sysadm/.m2/repository/com/google/gwt/gwt-user/1.5.2/gwt-user-1.5.2.jar":"/home/sysadm/.m2/repository/com/google/gwt/gwt-dev/1.5.2/gwt-dev-1.5.2-linux.jar":"/home/sysadm/.m2/repository/junit/junit/4.1/junit-4.1.jar":
>
> "/usr/lib/jvm/java-6-sun-1.6.0.07/jre/bin/java"  -Xmx512m
> -Djava.awt.headless=true  -cp $CLASSPATH junit.textui.TestRunner
> com.sinai.credentialing.client.GwtTestExampleA
>
>
> And here's the error message that I get:
>
> [EMAIL PROTECTED]:~/credentialing-msh$ ./target/gwtTest/
> gwtTest-com.sinai.credentialing.client.GwtTestExampleA.sh
> .E
> Time: 0.145
> There was 1 error:
> 1)
> testSomething(com.sinai.credentialing.client.GwtTestExampleA)org.eclipse.swt.SWTError:
> No more handles [gtk_init_check() failed]
>         at org.eclipse.swt.SWT.error(SWT.java:3400)
>         at org.eclipse.swt.widgets.Display.createDisplay(Display.java:793)
>         at org.eclipse.swt.widgets.Display.create(Display.java:781)
>         at org.eclipse.swt.graphics.Device.<init>(Device.java:145)
>         at org.eclipse.swt.widgets.Display.<init>(Display.java:452)
>         at org.eclipse.swt.widgets.Display.<init>(Display.java:443)
>         at org.eclipse.swt.widgets.Display.getDefault(Display.java:1522)
>         at com.google.gwt.dev.GWTShell.<init>(GWTShell.java:366)
>         at com.google.gwt.junit.JUnitShell.<init>(JUnitShell.java:287)
>         at
> com.google.gwt.junit.JUnitShell.getUnitTestShell(JUnitShell.java:204)
>         at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:150)
>         at
> com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:219)
>         at
> com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:132)
>
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 1
>
>
> As you can see from the script, it does include the
> "-Djava.awt.headless=true" JVM option, so I'm not really sure why it
> requires X still. I have a feeling it's the invisible hosted mode. Is there
> any way around this? For the moment, I'm going to install a light window
> manager like XFCE and run in run level 5, but I would prefer to be in run
> level 3. Thank you in advance.
>
> Regards,
> --
> Arthur Kalmenson
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to