Mittwoch, 24. Februar 2010
First official release of GwtGL - a WebGL binding for GWT
We recently released the first version of GwtGL.
GwtGL offers a GWT binding to enable developers to code WebGL apps using the Java language and toolset.
WebGL is a new web standard for hardware accelerated 3D graphics in web browsers. Soon all major web browsers (Firefox, Safari, Chrome, IE) will support WebGL - at the moment most of these browsers offer preview version that can be used to experience WebGL powered apps.
WebGL is based on OpenGL ES, so porting apps and games to the web is quite easy.
So, why do you need GwtGL when you could use WebGL directly?
WebGL is a javascript API, so you would have to program your application using Javascript. IMHO, this is a real pain for apps that are more complex than simple examples.
This is where GwtGL comes into play. Using GwtGL, which is Open Source and free to use, you can develop WebGL apps using the Java language, using your favorite Java IDE (e.g. Eclipse), using powerful Java tools.
GWT, GwtGLs underlying technology, uses a cross-compiler to compile your Java code to Javascript that can be run in the web browser. The compiler optimizes your code, so your app will probably run faster than it would if you coded it in Javascript directly.
The first release of GwtGL offers a complete binding for WebGL, so everything that is possible with WebGL directly is also possible using GwtGL. Besides that, GwtGL offers a wrapper layer on top of the binding to allow the developer to program in an object oriented, easier way. We also released a documentation with explanations and tutorials, and some examples that you can use as a starting point for your own apps.
I hope you enjoy using GwtGL!
GwtGL offers a GWT binding to enable developers to code WebGL apps using the Java language and toolset.
WebGL is a new web standard for hardware accelerated 3D graphics in web browsers. Soon all major web browsers (Firefox, Safari, Chrome, IE) will support WebGL - at the moment most of these browsers offer preview version that can be used to experience WebGL powered apps.
WebGL is based on OpenGL ES, so porting apps and games to the web is quite easy.
So, why do you need GwtGL when you could use WebGL directly?
WebGL is a javascript API, so you would have to program your application using Javascript. IMHO, this is a real pain for apps that are more complex than simple examples.
This is where GwtGL comes into play. Using GwtGL, which is Open Source and free to use, you can develop WebGL apps using the Java language, using your favorite Java IDE (e.g. Eclipse), using powerful Java tools.
GWT, GwtGLs underlying technology, uses a cross-compiler to compile your Java code to Javascript that can be run in the web browser. The compiler optimizes your code, so your app will probably run faster than it would if you coded it in Javascript directly.
The first release of GwtGL offers a complete binding for WebGL, so everything that is possible with WebGL directly is also possible using GwtGL. Besides that, GwtGL offers a wrapper layer on top of the binding to allow the developer to program in an object oriented, easier way. We also released a documentation with explanations and tutorials, and some examples that you can use as a starting point for your own apps.
I hope you enjoy using GwtGL!
Freitag, 29. Mai 2009
Debugging Grails Integration Tests
Running all unit/integration tests consumes a lot of time, so most of the time during development, you probably run single integration tests from the command line:
grails test-app -integration ClassUnderTest
If you want to debug an integration test to find out why a test is failing, follow the steps described below:
In IntelliJ, do the following:
- Create new run configuration (Edit configurations -> Add new configuration -> Remote)
- Enter name for the configuration
- Deselect "Make"
- Set brakepoint in your test class to make the debugger stop at this point.
Using the command line, run the single integration test using "grails-debug" instead of "grails". This will start grails in debugging mode (it will open a remote debug port).
grails-debug test-app -integration ClassUnderTest
Run your remote debugging session in IntelliJ by pressing on the debug button next to your run config...
If you use a different IDE like Eclipse or Netbeans, remote debugging should be as easy as described above.
Labels:
Debugging,
Grails,
Integration,
IntelliJ,
Testing
Montag, 18. Mai 2009
Custom Webtest steps for the Grails Webtest Plugin
Since version 0.6 of the grails webtest plugin, it is possible to create custom steps (http://www.leebutts.com/2009/01/grails-webtest-plugin-06-released.html):
So here is what you have to do:
Here is an example of a custom step. The step will log a greeting message. Our goal is to create a step that can be called in a webtest test class as shown below:
The implementation of the step is quite simple:
"You can now extend com.canoo.webtest.steps.Step by placing groovy classes in webtest/tests/step. They will be automatically loaded at runtime and allow for easy testing of complicated scenarios such as JSON interfaces and email integration"Unfortunately, there is no description or example how to actually create a custom step.
So here is what you have to do:
- Create directory webtest/tests/step
- Create Step Class. It is important that the class name ends with 'Step', otherwise it will not be picked up.
- Class must extend com.canoo.webtest.steps.Step
- Class must override void doExecute()
- Put the step's execution logic into the doExecute() method.
- To pass parameters to the step, define the step's arguments as properties of the step class.
- To validate the parameters, override void verifyParameters() and check the properties you defined. If property is not valid, throw IllegalArgumentException.
Here is an example of a custom step. The step will log a greeting message. Our goal is to create a step that can be called in a webtest test class as shown below:
def testGreeting() {
greeting(param:'grails')
}
The implementation of the step is quite simple:
import org.apache.log4j.Logger
class GreetingStep extends com.canoo.webtest.steps.Step {
private static Logger log = Logger.getLogger(GreetingStep)
String param
@Override
void doExecute(){
log.info "Hello $param"
}
@Override
protected void verifyParameters(){
if(!param) {
throw new IllegalArgumentException('param not set')
}
}
}
Place GreetingStep class in directory webtest/tests/step.
Samstag, 21. März 2009
My Java & Grails Blog has finally come to life!
This is the first post in my new blog.
I'm going to blog on Groovy and Grails related stuff, as well as interesting Java EE technologies.
Abonnieren
Posts (Atom)


