1 #set( $symbol_pound = '#' )
2 #set( $symbol_dollar = '$' )
3 #set( $symbol_escape = '\' )
4 package ${package}.${artifactId}.client;
6 import static com.google.gwt.query.client.GQuery.*;
7 import com.google.gwt.junit.client.GWTTestCase;
8 import com.google.gwt.query.client.GQuery;
9 import com.google.gwt.query.client.plugins.Effects.Speed;
10 import com.google.gwt.user.client.Event;
11 import com.google.gwt.user.client.Timer;
13 * Test class for ${projectName} entry-point
15 public class ${projectName}Test extends GWTTestCase {
17 public String getModuleName() {
18 return "${package}.${artifactId}.${projectName}";
21 private double fontSize(GQuery g) {
22 return $(g).cur("fontSize", true);
25 public void testOnModuleLoad() {
27 // Create a container in the document
28 final GQuery g = $("<div></div>").appendTo(document);
31 ${projectName} a = new ${projectName}();
35 delayTestFinish(Speed.DEFAULT * 5);
37 // trigger mouse over event
38 final double size1 = fontSize(g);
39 g.trigger(Event.ONMOUSEOVER);
42 // assert that the font size increases
43 assertTrue(fontSize(g) > size1);
45 // trigger mouse out event
46 final double size2 = fontSize(g);
47 g.trigger(Event.ONMOUSEOUT);
50 // assert that the font size decreases
51 assertTrue(fontSize(g) < size2);
57 }.schedule(Speed.DEFAULT);
59 }.schedule(Speed.DEFAULT);