aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java25
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTest.java12
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/JreQueryCoreTest.java2
-rw-r--r--samples/pom.xml4
-rw-r--r--samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml1
5 files changed, 40 insertions, 4 deletions
diff --git a/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java b/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java
index 48d0f053..1ce3966b 100644
--- a/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java
+++ b/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java
@@ -25,6 +25,7 @@ import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.query.client.js.JsCache;
+import com.google.gwt.query.client.js.JsNodeArray;
import com.google.gwt.query.client.js.JsUtils;
import com.google.gwt.query.client.plugins.effects.PropertiesAnimation;
import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing;
@@ -52,13 +53,35 @@ public class DevTestRunner extends MyTestCase implements EntryPoint {
public void onModuleLoad() {
try {
gwtSetUp();
- testCompareJquery();
+ testChrome__gwt_ObjectId();
} catch (Exception ex) {
ex.printStackTrace();
$(e).html("").after("<div>ERROR: " + ex.getMessage() + "</div>");
}
}
+ public void testChrome__gwt_ObjectId() {
+ JsCache a = JsCache.create();
+ assertEquals(0, a.length());
+ assertEquals(0, a.keys().length);
+ assertEquals(0, a.elements().length);
+
+ a.put("obj", new Long(21));
+ assertEquals(1, a.length());
+ assertEquals(1, a.keys().length);
+ assertEquals(1, a.elements().length);
+
+ JsNodeArray n = JsNodeArray.create();
+ assertEquals(0, n.getLength());
+ assertEquals(0, n.<JsCache>cast().keys().length);
+ assertEquals(0, n.elements().length);
+
+ n.addNode($("<hr/>").get(0));
+ assertEquals(1, n.getLength());
+ assertEquals(1, n.<JsCache>cast().keys().length);
+ assertEquals(1, n.elements().length);
+ }
+
public void testJsCache() {
String[] slist = new String[]{"A", "B", "C"};
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTest.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTest.java
index f740964d..c497bde6 100644
--- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTest.java
+++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTest.java
@@ -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"));
+ }
}
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/JreQueryCoreTest.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/JreQueryCoreTest.java
index 24337b77..a6df7a39 100644
--- a/gwtquery-core/src/test/java/com/google/gwt/query/client/JreQueryCoreTest.java
+++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/JreQueryCoreTest.java
@@ -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() {
diff --git a/samples/pom.xml b/samples/pom.xml
index 5b7a3754..024c885e 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -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>
diff --git a/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml
index 921732a7..48603d99 100644
--- a/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml
+++ b/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml
@@ -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>