You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/11/24 15:52:38 UTC
ignite git commit: IGNITE-1956: More tests.
Repository: ignite
Updated Branches:
refs/heads/ignite-1956 0dec2b9ed -> b245c221d
IGNITE-1956: More tests.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b245c221
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b245c221
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b245c221
Branch: refs/heads/ignite-1956
Commit: b245c221d947147a56f623256c0f071be63add73
Parents: 0dec2b9
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Nov 24 17:53:26 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Nov 24 17:53:26 2015 +0300
----------------------------------------------------------------------
.../internal/portable/BinaryEnumsSelfTest.java | 58 ++++++++++++++++----
1 file changed, 48 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b245c221/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryEnumsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryEnumsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryEnumsSelfTest.java
index 79f4dec..84d9423 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryEnumsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryEnumsSelfTest.java
@@ -135,8 +135,8 @@ public class BinaryEnumsSelfTest extends GridCommonAbstractTest {
*
* @throws Exception If failed.
*/
- public void testBuilderSimpleRegistered() throws Exception {
- checkBuilderSimple(true);
+ public void testSimpleBuilderRegistered() throws Exception {
+ checkSimpleBuilder(true);
}
/**
@@ -144,8 +144,8 @@ public class BinaryEnumsSelfTest extends GridCommonAbstractTest {
*
* @throws Exception If failed.
*/
- public void testBuilderSimpleNotRegistered() throws Exception {
- checkBuilderSimple(false);
+ public void testSimpleBuilderNotRegistered() throws Exception {
+ checkSimpleBuilder(false);
}
/**
@@ -168,7 +168,7 @@ public class BinaryEnumsSelfTest extends GridCommonAbstractTest {
* @param registered If type should be registered in advance.
* @throws Exception If failed.
*/
- public void checkBuilderSimple(boolean registered) throws Exception {
+ public void checkSimpleBuilder(boolean registered) throws Exception {
startUp(registered);
BinaryObject binary = node1.binary().buildEnum(EnumType.class.getSimpleName(), EnumType.ONE.ordinal());
@@ -178,14 +178,31 @@ public class BinaryEnumsSelfTest extends GridCommonAbstractTest {
validateSimple();
}
+ /**
+ * Test enum array (registered).
+ *
+ * @throws Exception If failed.
+ */
+ public void testSimpleArrayRegistered() throws Exception {
+ checkSimpleArray(true);
+ }
+
+ /**
+ * Test enum array (not registered).
+ *
+ * @throws Exception If failed.
+ */
+ public void testSimpleArrayNotRegistered() throws Exception {
+ checkSimpleArray(false);
+ }
/**
* Test enum array created using builder (registered).
*
* @throws Exception If failed.
*/
- public void testBuilderArrayRegistered() throws Exception {
- checkBuilderArray(true);
+ public void testSimpleBuilderArrayRegistered() throws Exception {
+ checkSimpleBuilderArray(true);
}
/**
@@ -193,8 +210,22 @@ public class BinaryEnumsSelfTest extends GridCommonAbstractTest {
*
* @throws Exception If failed.
*/
- public void testBuilderArrayNotRegistered() throws Exception {
- checkBuilderArray(false);
+ public void testSimpleBuilderArrayNotRegistered() throws Exception {
+ checkSimpleBuilderArray(false);
+ }
+
+ /**
+ * Check arrays with builder.
+ *
+ * @param registered Registered flag.
+ * @throws Exception If failed.
+ */
+ public void checkSimpleArray(boolean registered) throws Exception {
+ startUp(registered);
+
+ cache1.put(1, new EnumType[] { EnumType.ONE, EnumType.TWO });
+
+ validateSimpleArray();
}
/**
@@ -203,7 +234,7 @@ public class BinaryEnumsSelfTest extends GridCommonAbstractTest {
* @param registered Registered flag.
* @throws Exception If failed.
*/
- public void checkBuilderArray(boolean registered) throws Exception {
+ public void checkSimpleBuilderArray(boolean registered) throws Exception {
startUp(registered);
BinaryObject binaryOne = node1.binary().buildEnum(EnumType.class.getSimpleName(), EnumType.ONE.ordinal());
@@ -211,6 +242,13 @@ public class BinaryEnumsSelfTest extends GridCommonAbstractTest {
cacheBinary1.put(1, new BinaryObject[] { binaryOne, binaryTwo });
+ validateSimpleArray();
+ }
+
+ /**
+ * Validate simple array.
+ */
+ private void validateSimpleArray() {
Object[] arr1 = (Object[])cache1.get(1);
Object[] arr2 = (Object[])cache2.get(1);