]> source.dussan.org Git - gwtquery.git/commitdiff
more tests
authorManolo Carrasco <manolo@apache.org>
Sat, 23 Apr 2011 09:41:23 +0000 (09:41 +0000)
committerManolo Carrasco <manolo@apache.org>
Sat, 23 Apr 2011 09:41:23 +0000 (09:41 +0000)
devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java
gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTest.java
gwtquery-core/src/test/java/com/google/gwt/query/client/JreQueryCoreTest.java
samples/pom.xml
samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml

index 48d0f05375127556d95762ed61cad2a56e3efd44..1ce3966b1db1949e6c123bc6a0a911913105f449 100644 (file)
@@ -25,6 +25,7 @@ import com.google.gwt.event.dom.client.FocusHandler;
 import com.google.gwt.event.shared.GwtEvent;\r
 import com.google.gwt.event.shared.HandlerRegistration;\r
 import com.google.gwt.query.client.js.JsCache;\r
+import com.google.gwt.query.client.js.JsNodeArray;\r
 import com.google.gwt.query.client.js.JsUtils;\r
 import com.google.gwt.query.client.plugins.effects.PropertiesAnimation;\r
 import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing;\r
@@ -52,13 +53,35 @@ public class DevTestRunner extends MyTestCase implements EntryPoint {
   public void onModuleLoad() {\r
     try {\r
       gwtSetUp();\r
-      testCompareJquery();\r
+      testChrome__gwt_ObjectId();\r
     } catch (Exception ex) {\r
       ex.printStackTrace();\r
       $(e).html("").after("<div>ERROR: " + ex.getMessage() + "</div>");\r
     }\r
   }\r
   \r
+  public void testChrome__gwt_ObjectId() {\r
+    JsCache a = JsCache.create();\r
+    assertEquals(0, a.length());\r
+    assertEquals(0, a.keys().length);\r
+    assertEquals(0, a.elements().length);\r
+    \r
+    a.put("obj", new Long(21));\r
+    assertEquals(1, a.length());\r
+    assertEquals(1, a.keys().length);\r
+    assertEquals(1, a.elements().length);\r
+    \r
+    JsNodeArray n = JsNodeArray.create();\r
+    assertEquals(0, n.getLength());\r
+    assertEquals(0, n.<JsCache>cast().keys().length);\r
+    assertEquals(0, n.elements().length);\r
+    \r
+    n.addNode($("<hr/>").get(0));\r
+    assertEquals(1, n.getLength());\r
+    assertEquals(1, n.<JsCache>cast().keys().length);\r
+    assertEquals(1, n.elements().length);\r
+  }\r
+  \r
   public void testJsCache() {\r
     String[] slist = new String[]{"A", "B", "C"};\r
     \r
index f740964d59a7a7da146cbca7bd59c6c2e783dcaf..c497bde62241ba7b6d184462c0622ced3e6d3c3b 100644 (file)
@@ -15,7 +15,7 @@
  */
 package com.google.gwt.query.client;
 
-import static com.google.gwt.query.client.GQuery.$;
+import static com.google.gwt.query.client.GQuery.*;
 
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.junit.client.GWTTestCase;
@@ -108,4 +108,14 @@ public class GQueryJsTest extends GWTTestCase {
     assertEquals(1, n.<JsCache>cast().keys().length);
     assertEquals(1, n.elements().length);
   }
+  
+  public void testProperties() {
+    Properties p = $$("b: 'a'; c: 1, /*gg: aadf*/d: url('https://test.com');");
+    assertEquals(3, p.keys().length);
+    assertEquals("url(https://test.com)", p.getStr("d"));
+    
+    p = $$("color: 'rgb(0, 0,139)', background: red");
+    assertEquals(2, p.keys().length);
+    assertEquals("rgb(0,0,139)", p.getStr("color"));
+  }
 }
index 24337b7771623d7e20cefaa32cdddffb3df5e90c..a6df7a39e0b5c71c94c9746289be6acd30f9a040 100644 (file)
@@ -23,7 +23,7 @@ import com.google.gwt.junit.client.GWTTestCase;
 public class JreQueryCoreTest extends GWTTestCase {
 
   public String getModuleName() {
-    return null;
+    return null; //"com.google.gwt.query.Query";
   }
 
   public void testAssertHtmlEquals() {
index 5b7a37547370ce10b73013c61633e799adc58652..024c885e13741fe048551f3d55803db8428a1d5e 100644 (file)
@@ -44,8 +44,9 @@
                     <gwtVersion>${gwtversion}</gwtVersion>
                     <compileReport>true</compileReport>
                     <modules>
-                        <module>gwtquery.samples.JsCollectionVsJavaCollection</module>
                         <module>gwtquery.samples.GwtQueryBench</module>
+<!--
+                        <module>gwtquery.samples.JsCollectionVsJavaCollection</module>
                         <module>gwtquery.samples.GwtQuerySample</module>
                         <module>gwtquery.samples.GwtQueryDemo</module>
                         <module>gwtquery.samples.GwtQueryEffects</module>
@@ -53,6 +54,7 @@
                         <module>gwtquery.samples.GwtQueryImageZoom</module>
                         <module>gwtquery.samples.FadeEffectsSample</module>
                         <module>gwtquery.samples.SlideEffectsSample</module>
+-->
                     </modules>
                 </configuration>
                 <executions>
index 921732a77dd365c8c1092e3cfcd073a8fc472992..48603d99385e06bbbbe72285a3f8e28d99a06764 100644 (file)
@@ -1,5 +1,6 @@
 <module>
     <inherits name='com.google.gwt.query.Query'/>
     <entry-point class='gwtquery.samples.client.GwtQueryBenchModule'/>
+    <inherits name="com.google.gwt.precompress.Precompress"/>
 </module>