diff options
author | jdramaix <julien.dramaix@gmail.com> | 2014-09-27 00:23:58 +0200 |
---|---|---|
committer | jdramaix <julien.dramaix@gmail.com> | 2014-09-27 00:23:58 +0200 |
commit | 1a620a3fabd5072d9bfa8f38d86a17f3c441b707 (patch) | |
tree | f709b297c2501c4f231d437d40984ae4a7497ece /gwtquery-core/src/test | |
parent | e8e5739fc12d16534693f4714295e50590758be4 (diff) | |
download | gwtquery-jd_fix_data_string.tar.gz gwtquery-jd_fix_data_string.zip |
Fix bug with data("nonExistingKey", String.class)jd_fix_data_string
Diffstat (limited to 'gwtquery-core/src/test')
-rw-r--r-- | gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java index f5a5d157..f4a4d963 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java @@ -15,6 +15,11 @@ */ package com.google.gwt.query.client; +import static com.google.gwt.query.client.GQuery.$; +import static com.google.gwt.query.client.GQuery.$$; +import static com.google.gwt.query.client.GQuery.document; +import static com.google.gwt.query.client.GQuery.window; + import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.InputElement; @@ -50,11 +55,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; -import static com.google.gwt.query.client.GQuery.$; -import static com.google.gwt.query.client.GQuery.$$; -import static com.google.gwt.query.client.GQuery.document; -import static com.google.gwt.query.client.GQuery.window; - /** * Test class for testing gwtquery-core api. */ @@ -1557,6 +1557,16 @@ public class GQueryCoreTestGwt extends GWTTestCase { assertEquals("red", $(parent).css(CSS.BACKGROUND_COLOR, false)); } + public void testDataString() { + // put something in the cache for the element + $(e).data("initCache", "initCache"); + + assertNotNull($(e).data("initCache", String.class)); + + // returned the string "null" before the patch + assertNull($(e).data("nonExistingKey", String.class)); + } + public void testData() { assertEquals(null, $().data("whatever")); |