ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [05/50] [abbrv] incubator-ignite git commit: # ignite-6
Date Thu, 05 Feb 2015 14:05:05 GMT
# ignite-6


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/81625f51
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/81625f51
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/81625f51

Branch: refs/heads/ignite-54-55
Commit: 81625f5135abbf27a290bdc084fbd5d78a6b6e01
Parents: 5c65bf7
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Feb 4 14:32:28 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Feb 4 14:32:28 2015 +0300

----------------------------------------------------------------------
 .../GridCacheAbstractFieldsQuerySelfTest.java   | 159 ++++++++++---------
 1 file changed, 82 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81625f51/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
index 32f29b6..6e2b87f 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
@@ -182,86 +182,91 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
         // Put internal key to test filtering of internal objects.
         grid(0).cache(null).put(new GridCacheInternalKeyImpl("LONG"), new GridCacheAtomicLongValue(0));
 
-        Collection<GridCacheSqlMetadata> metas =
-            ((GridCacheQueriesEx<?, ?>)grid(0).cache(null).queries()).sqlMetadata();
-
-        assert metas != null;
-        assertEquals("Invalid meta: " + metas, 3, metas.size());
-
-        boolean wasNull = false;
-        boolean wasNamed = false;
-        boolean wasEmpty = false;
-
-        for (GridCacheSqlMetadata meta : metas) {
-            if (meta.cacheName() == null) {
-                Collection<String> types = meta.types();
-
-                assert types != null;
-                assert types.size() == 4;
-                assert types.contains("Person");
-                assert types.contains("Organization");
-                assert types.contains("String");
-                assert types.contains("Integer");
-
-                assert CacheAffinityKey.class.getName().equals(meta.keyClass("Person"));
-                assert String.class.getName().equals(meta.keyClass("Organization"));
-                assert String.class.getName().equals(meta.keyClass("String"));
-
-                assert Person.class.getName().equals(meta.valueClass("Person"));
-                assert Organization.class.getName().equals(meta.valueClass("Organization"));
-                assert String.class.getName().equals(meta.valueClass("String"));
-
-                Map<String, String> fields = meta.fields("Person");
-
-                assert fields != null;
-                assert fields.size() == 5;
-                assert CacheAffinityKey.class.getName().equals(fields.get("_KEY"));
-                assert Person.class.getName().equals(fields.get("_VAL"));
-                assert String.class.getName().equals(fields.get("NAME"));
-                assert int.class.getName().equals(fields.get("AGE"));
-                assert int.class.getName().equals(fields.get("ORGID"));
-
-                fields = meta.fields("Organization");
-
-                assert fields != null;
-                assert fields.size() == 4;
-                assert String.class.getName().equals(fields.get("_KEY"));
-                assert Organization.class.getName().equals(fields.get("_VAL"));
-                assert int.class.getName().equals(fields.get("ID"));
-                assert String.class.getName().equals(fields.get("NAME"));
-
-                fields = meta.fields("String");
-
-                assert fields != null;
-                assert fields.size() == 2;
-                assert String.class.getName().equals(fields.get("_KEY"));
-                assert String.class.getName().equals(fields.get("_VAL"));
-
-                fields = meta.fields("Integer");
-
-                assert fields != null;
-                assert fields.size() == 2;
-                assert Integer.class.getName().equals(fields.get("_KEY"));
-                assert Integer.class.getName().equals(fields.get("_VAL"));
-
-                Collection<GridCacheSqlIndexMetadata> indexes = meta.indexes("Person");
-
-                assertEquals(2, indexes.size());
-
-                wasNull = true;
+        try {
+            Collection<GridCacheSqlMetadata> metas =
+                ((GridCacheQueriesEx<?, ?>)grid(0).cache(null).queries()).sqlMetadata();
+
+            assert metas != null;
+            assertEquals("Invalid meta: " + metas, 3, metas.size());
+
+            boolean wasNull = false;
+            boolean wasNamed = false;
+            boolean wasEmpty = false;
+
+            for (GridCacheSqlMetadata meta : metas) {
+                if (meta.cacheName() == null) {
+                    Collection<String> types = meta.types();
+
+                    assert types != null;
+                    assert types.size() == 4;
+                    assert types.contains("Person");
+                    assert types.contains("Organization");
+                    assert types.contains("String");
+                    assert types.contains("Integer");
+
+                    assert CacheAffinityKey.class.getName().equals(meta.keyClass("Person"));
+                    assert String.class.getName().equals(meta.keyClass("Organization"));
+                    assert String.class.getName().equals(meta.keyClass("String"));
+
+                    assert Person.class.getName().equals(meta.valueClass("Person"));
+                    assert Organization.class.getName().equals(meta.valueClass("Organization"));
+                    assert String.class.getName().equals(meta.valueClass("String"));
+
+                    Map<String, String> fields = meta.fields("Person");
+
+                    assert fields != null;
+                    assert fields.size() == 5;
+                    assert CacheAffinityKey.class.getName().equals(fields.get("_KEY"));
+                    assert Person.class.getName().equals(fields.get("_VAL"));
+                    assert String.class.getName().equals(fields.get("NAME"));
+                    assert int.class.getName().equals(fields.get("AGE"));
+                    assert int.class.getName().equals(fields.get("ORGID"));
+
+                    fields = meta.fields("Organization");
+
+                    assert fields != null;
+                    assert fields.size() == 4;
+                    assert String.class.getName().equals(fields.get("_KEY"));
+                    assert Organization.class.getName().equals(fields.get("_VAL"));
+                    assert int.class.getName().equals(fields.get("ID"));
+                    assert String.class.getName().equals(fields.get("NAME"));
+
+                    fields = meta.fields("String");
+
+                    assert fields != null;
+                    assert fields.size() == 2;
+                    assert String.class.getName().equals(fields.get("_KEY"));
+                    assert String.class.getName().equals(fields.get("_VAL"));
+
+                    fields = meta.fields("Integer");
+
+                    assert fields != null;
+                    assert fields.size() == 2;
+                    assert Integer.class.getName().equals(fields.get("_KEY"));
+                    assert Integer.class.getName().equals(fields.get("_VAL"));
+
+                    Collection<GridCacheSqlIndexMetadata> indexes = meta.indexes("Person");
+
+                    assertEquals(2, indexes.size());
+
+                    wasNull = true;
+                }
+                else if (CACHE.equals(meta.cacheName()))
+                    wasNamed = true;
+                else if (EMPTY_CACHE.equals(meta.cacheName())) {
+                    assert meta.types().isEmpty();
+
+                    wasEmpty = true;
+                }
             }
-            else if (CACHE.equals(meta.cacheName()))
-                wasNamed = true;
-            else if (EMPTY_CACHE.equals(meta.cacheName())) {
-                assert meta.types().isEmpty();
 
-                wasEmpty = true;
-            }
+            assert wasNull;
+            assert wasNamed;
+            assert wasEmpty;
+        }
+        finally {
+            grid(0).cache(null).removex(new GridCacheInternalKeyImpl("LONG"));
         }
-
-        assert wasNull;
-        assert wasNamed;
-        assert wasEmpty;
     }
 
     /** @throws Exception If failed. */


Mime
View raw message