http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java index 8635f69..eaca668 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java @@ -96,6 +96,9 @@ import org.apache.ignite.testframework.junits.GridTestKernalContext; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static java.nio.charset.StandardCharsets.UTF_8; import static org.apache.ignite.internal.binary.streams.BinaryMemoryAllocator.INSTANCE; @@ -106,10 +109,12 @@ import static org.junit.Assert.assertNotEquals; * Binary marshaller tests. */ @SuppressWarnings({"OverlyStrongTypeCast", "ConstantConditions"}) +@RunWith(JUnit4.class) public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNull() throws Exception { assertNull(marshalUnmarshal(null)); } @@ -117,6 +122,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testByte() throws Exception { assertEquals((byte)100, marshalUnmarshal((byte)100).byteValue()); } @@ -124,6 +130,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testShort() throws Exception { assertEquals((short)100, marshalUnmarshal((short)100).shortValue()); } @@ -131,6 +138,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testInt() throws Exception { assertEquals(100, marshalUnmarshal(100).intValue()); } @@ -138,6 +146,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testLong() throws Exception { assertEquals(100L, marshalUnmarshal(100L).longValue()); } @@ -145,6 +154,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFloat() throws Exception { assertEquals(100.001f, marshalUnmarshal(100.001f), 0); } @@ -152,6 +162,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDouble() throws Exception { assertEquals(100.001d, marshalUnmarshal(100.001d), 0); } @@ -159,6 +170,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testChar() throws Exception { assertEquals((char)100, marshalUnmarshal((char)100).charValue()); } @@ -166,6 +178,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBoolean() throws Exception { assertEquals(true, marshalUnmarshal(true).booleanValue()); } @@ -173,6 +186,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDecimal() throws Exception { BigDecimal val; @@ -189,6 +203,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNegativeScaleDecimal() throws Exception { BigDecimal val; @@ -201,6 +216,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testNegativeScaleRoundingModeDecimal() throws Exception { BigDecimal val; @@ -217,6 +233,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStringVer1() throws Exception { doTestString(false); } @@ -224,6 +241,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStringVer2() throws Exception { doTestString(true); } @@ -285,6 +303,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testUuid() throws Exception { UUID uuid = UUID.randomUUID(); @@ -294,6 +313,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIgniteUuid() throws Exception { IgniteUuid uuid = IgniteUuid.randomUuid(); @@ -303,6 +323,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDate() throws Exception { Date date = new Date(); @@ -315,6 +336,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testTimestamp() throws Exception { Timestamp ts = new Timestamp(System.currentTimeMillis()); @@ -326,6 +348,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testTime() throws Exception { Time time = new Time(System.currentTimeMillis()); assertEquals(time, marshalUnmarshal(time)); @@ -334,6 +357,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testTimeArray() throws Exception { Time[] times = new Time[]{new Time(System.currentTimeMillis()), new Time(123456789)}; assertArrayEquals(times, marshalUnmarshal(times)); @@ -342,6 +366,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testByteArray() throws Exception { byte[] arr = new byte[] {10, 20, 30}; @@ -351,6 +376,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testShortArray() throws Exception { short[] arr = new short[] {10, 20, 30}; @@ -360,6 +386,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testIntArray() throws Exception { int[] arr = new int[] {10, 20, 30}; @@ -369,6 +396,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testLongArray() throws Exception { long[] arr = new long[] {10, 20, 30}; @@ -378,6 +406,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFloatArray() throws Exception { float[] arr = new float[] {10.1f, 20.1f, 30.1f}; @@ -387,6 +416,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDoubleArray() throws Exception { double[] arr = new double[] {10.1d, 20.1d, 30.1d}; @@ -396,6 +426,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCharArray() throws Exception { char[] arr = new char[] {10, 20, 30}; @@ -405,6 +436,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBooleanArray() throws Exception { boolean[] arr = new boolean[] {true, false, true}; @@ -414,6 +446,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDecimalArray() throws Exception { BigDecimal[] arr = new BigDecimal[] {BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.TEN}; @@ -423,6 +456,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testStringArray() throws Exception { String[] arr = new String[] {"str1", "str2", "str3"}; @@ -432,6 +466,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testUuidArray() throws Exception { UUID[] arr = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()}; @@ -441,6 +476,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDateArray() throws Exception { Date[] arr = new Date[] {new Date(11111), new Date(22222), new Date(33333)}; @@ -450,6 +486,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testObjectArray() throws Exception { Object[] arr = new Object[] {1, 2, 3}; @@ -459,6 +496,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testException() throws Exception { Exception ex = new RuntimeException(); @@ -470,6 +508,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCollection() throws Exception { testCollection(new ArrayList<Integer>(3)); testCollection(new LinkedHashSet<Integer>()); @@ -492,6 +531,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMap() throws Exception { testMap(new HashMap<Integer, String>()); testMap(new LinkedHashMap<Integer, String>()); @@ -517,6 +557,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { * @throws Exception If failed. */ @SuppressWarnings("unchecked") + @Test public void testCustomCollections() throws Exception { CustomCollections cc = new CustomCollections(); @@ -540,6 +581,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { * @throws Exception If failed. */ @SuppressWarnings("unchecked") + @Test public void testCustomCollections2() throws Exception { CustomArrayList arrList = new CustomArrayList(); @@ -562,6 +604,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { * @throws Exception If failed. */ @SuppressWarnings("unchecked") + @Test public void testCustomCollectionsWithFactory() throws Exception { CustomCollectionsWithFactory cc = new CustomCollectionsWithFactory(); @@ -580,6 +623,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testExternalizableInEnclosing() throws Exception { SimpleEnclosingObject obj = new SimpleEnclosingObject(); obj.simpl = new SimpleExternalizable("field"); @@ -592,6 +636,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMapEntry() throws Exception { Map.Entry<Integer, String> e = new GridMapEntry<>(1, "str1"); @@ -612,6 +657,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryObject() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(new BinaryTypeConfiguration(SimpleObject.class.getName()))); @@ -639,6 +685,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testEnum() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(new BinaryTypeConfiguration(TestEnum.class.getName()))); @@ -648,6 +695,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDeclaredBodyEnum() throws Exception { final MarshallerContextTestImpl ctx = new MarshallerContextTestImpl(); ctx.registerClassName((byte)0, 1, EnumObject.class.getName()); @@ -674,6 +722,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDateAndTimestampInSingleObject() throws Exception { BinaryTypeConfiguration cfg1 = new BinaryTypeConfiguration(DateClass1.class.getName()); @@ -711,6 +760,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSimpleObject() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -794,6 +844,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinary() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()), @@ -915,6 +966,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testObjectFieldOfExternalizableCollection() throws Exception { EnclosingObj obj = new EnclosingObj(); @@ -926,6 +978,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testVoid() throws Exception { Class clazz = Void.class; @@ -939,6 +992,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testWriteReplacePrivate() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Collections.singleton( new BinaryTypeConfiguration(TestObject.class.getName()) @@ -956,6 +1010,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testWriteReplaceInheritable() throws Exception { ImmutableList<String> obj = ImmutableList.of("This is a test"); @@ -1113,6 +1168,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testClassWithoutPublicConstructor() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(NoPublicConstructor.class.getName()), @@ -1139,6 +1195,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCustomSerializer() throws Exception { BinaryTypeConfiguration type = new BinaryTypeConfiguration(CustomSerializedObject1.class.getName()); @@ -1157,6 +1214,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCustomSerializerWithGlobal() throws Exception { BinaryTypeConfiguration type1 = new BinaryTypeConfiguration(CustomSerializedObject1.class.getName()); @@ -1183,6 +1241,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCustomIdMapper() throws Exception { BinaryTypeConfiguration type = new BinaryTypeConfiguration(CustomMappedObject1.class.getName()); @@ -1223,6 +1282,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCustomIdMapperWithGlobal() throws Exception { BinaryTypeConfiguration type1 = new BinaryTypeConfiguration(CustomMappedObject1.class.getName()); @@ -1293,6 +1353,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSimpleNameLowerCaseMappers() throws Exception { BinaryTypeConfiguration innerClassType = new BinaryTypeConfiguration(InnerMappedObject.class.getName()); BinaryTypeConfiguration publicClassType = new BinaryTypeConfiguration(TestMappedObject.class.getName()); @@ -1350,6 +1411,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDynamicObject() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(DynamicObject.class.getName()) @@ -1395,6 +1457,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCycleLink() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(CycleLinkObject.class.getName()) @@ -1414,6 +1477,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDetached() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(DetachedTestObject.class.getName()), @@ -1468,6 +1532,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCollectionFields() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(CollectionFieldsObject.class.getName()), @@ -1508,6 +1573,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDefaultMapping() throws Exception { BinaryTypeConfiguration customMappingType = new BinaryTypeConfiguration(TestBinary.class.getName()); @@ -1546,6 +1612,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testTypeNamesSimpleNameMapper() throws Exception { BinaryTypeConfiguration customType1 = new BinaryTypeConfiguration(Value.class.getName()); @@ -1624,6 +1691,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testTypeNamesFullNameMappers() throws Exception { BinaryTypeConfiguration customType1 = new BinaryTypeConfiguration(Value.class.getName()); @@ -1702,6 +1770,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testTypeNamesSimpleNameMappers() throws Exception { BinaryTypeConfiguration customType1 = new BinaryTypeConfiguration(Value.class.getName()); @@ -1789,6 +1858,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testTypeNamesCustomIdMapper() throws Exception { BinaryTypeConfiguration customType1 = new BinaryTypeConfiguration(Value.class.getName()); @@ -1903,6 +1973,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCustomTypeRegistration() throws Exception { BinaryTypeConfiguration customType = new BinaryTypeConfiguration(Value.class.getName()); @@ -1944,6 +2015,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testFieldIdMapping() throws Exception { BinaryTypeConfiguration customType1 = new BinaryTypeConfiguration(Value.class.getName()); @@ -2008,6 +2080,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDuplicateTypeId() throws Exception { BinaryTypeConfiguration customType1 = new BinaryTypeConfiguration("org.gridgain.Class1"); @@ -2049,6 +2122,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopy() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2172,6 +2246,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyString() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2193,6 +2268,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyUuid() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2216,6 +2292,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyByteArray() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2253,6 +2330,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyShortArray() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2274,6 +2352,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyIntArray() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2295,6 +2374,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyLongArray() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2316,6 +2396,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyFloatArray() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2337,6 +2418,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyDoubleArray() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2358,6 +2440,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyCharArray() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2379,6 +2462,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyStringArray() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2400,6 +2484,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyObject() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2427,6 +2512,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyNonPrimitives() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(SimpleObject.class.getName()) @@ -2464,6 +2550,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryCopyMixed() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(new BinaryTypeConfiguration(SimpleObject.class.getName()))); @@ -2508,6 +2595,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testKeepDeserialized() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(new BinaryTypeConfiguration(SimpleObject.class.getName()))); @@ -2525,6 +2613,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testOffheapBinary() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(new BinaryTypeConfiguration(SimpleObject.class.getName()))); @@ -2619,6 +2708,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testReadResolve() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Arrays.asList( new BinaryTypeConfiguration(MySingleton.class.getName()), @@ -2636,6 +2726,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testReadResolveOnBinaryAware() throws Exception { BinaryMarshaller marsh = binaryMarshaller(Collections.singletonList( new BinaryTypeConfiguration(MyTestClass.class.getName()))); @@ -2650,6 +2741,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * */ + @Test public void testDecimalFields() throws Exception { Collection<BinaryTypeConfiguration> clsNames = new ArrayList<>(); @@ -2720,6 +2812,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws IgniteCheckedException If failed. */ + @Test public void testFinalField() throws IgniteCheckedException { BinaryMarshaller marsh = binaryMarshaller(); @@ -2733,6 +2826,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws IgniteCheckedException If failed. */ + @Test public void testThreadLocalArrayReleased() throws Exception { // Checking the writer directly. assertEquals(false, INSTANCE.isAcquired()); @@ -2774,6 +2868,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDuplicateNameSimpleNameMapper() throws Exception { BinaryMarshaller marsh = binaryMarshaller(new BinaryBasicNameMapper(true), new BinaryBasicIdMapper(true), null, null, null); @@ -2798,6 +2893,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testDuplicateNameFullNameMapper() throws Exception { BinaryMarshaller marsh = binaryMarshaller(new BinaryBasicNameMapper(false), new BinaryBasicIdMapper(false), null, null, null); @@ -2813,6 +2909,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testClass() throws Exception { BinaryMarshaller marsh = binaryMarshaller(); @@ -2826,6 +2923,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testClassFieldsMarshalling() throws Exception { BinaryMarshaller marsh = binaryMarshaller(); @@ -2849,6 +2947,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMarshallingThroughJdk() throws Exception { BinaryMarshaller marsh = binaryMarshaller(); @@ -2885,6 +2984,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testPredefinedTypeIds() throws Exception { BinaryMarshaller marsh = binaryMarshaller(); @@ -2913,6 +3013,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testProxy() throws Exception { BinaryMarshaller marsh = binaryMarshaller(); @@ -2942,6 +3043,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { * * @throws Exception If fails. */ + @Test public void testObjectContainingProxy() throws Exception { BinaryMarshaller marsh = binaryMarshaller(); @@ -2971,6 +3073,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testDuplicateFields() throws Exception { BinaryMarshaller marsh = binaryMarshaller(); @@ -3026,6 +3129,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testSingleHandle() throws Exception { SingleHandleA a = new SingleHandleA(new SingleHandleB()); @@ -3041,6 +3145,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testUnregisteredClass() throws Exception { BinaryMarshaller m = binaryMarshaller(null, Collections.singletonList(Value.class.getName())); @@ -3052,6 +3157,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testMixedRawCollections() throws Exception { Collection<String> excludedClasses = Arrays.asList( ObjectRaw.class.getName(), @@ -3079,6 +3185,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryEquals() throws Exception { Collection<String> excludedClasses = Arrays.asList( ObjectRaw.class.getName(), @@ -3214,6 +3321,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testBinaryEqualsComplexObject() throws Exception { List<String> excludedClasses = Arrays.asList( TestClass0.class.getName(), @@ -3272,6 +3380,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testFieldOrder() throws Exception { if (BinaryUtils.FIELDS_SORTED_ORDER) return; @@ -3301,6 +3410,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testFieldOrderByBuilder() throws Exception { if (BinaryUtils.FIELDS_SORTED_ORDER) return;
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java index 95fa0e0..5a40543 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java @@ -69,6 +69,9 @@ import org.apache.ignite.marshaller.MarshallerContext; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheMode.PARTITIONED; import static org.apache.ignite.cache.CacheMode.REPLICATED; @@ -76,6 +79,7 @@ import static org.apache.ignite.cache.CacheMode.REPLICATED; /** * */ +@RunWith(JUnit4.class) public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTest { /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { @@ -127,6 +131,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * @throws Exception If failed. */ + @Test public void testSimpleTypeFieldRead() throws Exception { GridBinaryTestClasses.TestObjectAllTypes exp = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -161,6 +166,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testSimpleTypeFieldSerialize() { GridBinaryTestClasses.TestObjectAllTypes exp = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -176,6 +182,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * @throws Exception If any error occurs. */ + @Test public void testSimpleTypeFieldOverride() throws Exception { GridBinaryTestClasses.TestObjectAllTypes exp = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -194,6 +201,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * @throws Exception If any error occurs. */ + @Test public void testSimpleTypeFieldSetNull() throws Exception { GridBinaryTestClasses.TestObjectAllTypes exp = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -217,6 +225,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * @throws IgniteCheckedException If any error occurs. */ + @Test public void testMakeCyclicDependency() throws IgniteCheckedException { GridBinaryTestClasses.TestObjectOuter outer = new GridBinaryTestClasses.TestObjectOuter(); outer.inner = new GridBinaryTestClasses.TestObjectInner(); @@ -237,6 +246,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testDateArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -255,6 +265,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testTimestampArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -273,6 +284,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testUUIDArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -291,6 +303,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testDecimalArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -310,6 +323,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testBooleanArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -333,6 +347,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testCharArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -351,6 +366,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testDoubleArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -369,6 +385,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testFloatArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -389,6 +406,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testLongArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -407,6 +425,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testIntArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -425,6 +444,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testShortArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -443,6 +463,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testByteArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -461,6 +482,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testStringArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -479,6 +501,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testModifyObjectArray() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = new Object[] {"a"}; @@ -499,6 +522,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testOverrideObjectArrayField() { BinaryObjectBuilderImpl mutObj = wrap(new GridBinaryTestClasses.TestObjectContainer()); @@ -516,6 +540,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testDeepArray() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = new Object[] {new Object[] {"a", obj}}; @@ -540,6 +565,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testArrayListRead() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = Lists.newArrayList(obj, "a"); @@ -554,6 +580,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testArrayListOverride() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -574,6 +601,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testArrayListModification() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = Lists.newArrayList("a", "b", "c"); @@ -601,6 +629,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testArrayListClear() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = Lists.newArrayList("a", "b", "c"); @@ -617,6 +646,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testArrayListWriteUnmodifiable() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -638,6 +668,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testLinkedListRead() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = Lists.newLinkedList(Arrays.asList(obj, "a")); @@ -652,6 +683,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testLinkedListOverride() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -672,6 +704,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testLinkedListModification() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -700,6 +733,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testLinkedListWriteUnmodifiable() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -721,6 +755,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testHashSetRead() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = Sets.newHashSet(obj, "a"); @@ -735,6 +770,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testHashSetOverride() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -756,6 +792,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testHashSetModification() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = Sets.newHashSet("a", "b", "c"); @@ -780,6 +817,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testHashSetWriteUnmodifiable() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -800,6 +838,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testMapRead() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = Maps.newHashMap(ImmutableMap.of(obj, "a", "b", obj)); @@ -814,6 +853,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testMapOverride() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -831,6 +871,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testMapModification() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = Maps.newHashMap(ImmutableMap.of(1, "a", 2, "b")); @@ -852,6 +893,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testEnumArrayModification() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); @@ -870,6 +912,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testEditObjectWithRawData() { GridBinaryMarshalerAwareTestClass obj = new GridBinaryMarshalerAwareTestClass(); @@ -888,6 +931,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testHashCode() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -901,6 +945,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testCollectionsInCollection() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); obj.foo = Lists.newArrayList( @@ -918,6 +963,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testMapEntryOverride() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -933,6 +979,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testMetadataChangingDoublePut() { BinaryObjectBuilderImpl mutableObj = wrap(new GridBinaryTestClasses.TestObjectContainer()); @@ -949,6 +996,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testMetadataChangingDoublePut2() { BinaryObjectBuilderImpl mutableObj = wrap(new GridBinaryTestClasses.TestObjectContainer()); @@ -965,6 +1013,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testMetadataChanging() { GridBinaryTestClasses.TestObjectContainer c = new GridBinaryTestClasses.TestObjectContainer(); @@ -999,6 +1048,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testWrongMetadataNullField() { BinaryObjectBuilder builder = binaries().builder("SomeType"); @@ -1036,6 +1086,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testWrongMetadataNullField2() { BinaryObjectBuilder builder = binaries().builder("SomeType1"); @@ -1073,6 +1124,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testCorrectMetadataNullField() { BinaryObjectBuilder builder = binaries().builder("SomeType2"); @@ -1095,6 +1147,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testCorrectMetadataNullField2() { BinaryObjectBuilder builder = binaries().builder("SomeType3"); @@ -1116,6 +1169,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testDateInObjectField() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -1129,6 +1183,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testTimestampInObjectField() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -1142,6 +1197,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testDateInCollection() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -1155,6 +1211,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testTimestampInCollection() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -1168,6 +1225,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testDateArrayOverride() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -1186,6 +1244,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testTimestampArrayOverride() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -1204,6 +1263,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testChangeMap() { GridBinaryTestClasses.Addresses addrs = new GridBinaryTestClasses.Addresses(); @@ -1246,6 +1306,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testSavingObjectWithNotZeroStart() { GridBinaryTestClasses.TestObjectOuter out = new GridBinaryTestClasses.TestObjectOuter(); GridBinaryTestClasses.TestObjectInner inner = new GridBinaryTestClasses.TestObjectInner(); @@ -1265,6 +1326,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testBinaryObjectField() { GridBinaryTestClasses.TestObjectContainer container = new GridBinaryTestClasses.TestObjectContainer(toBinary(new GridBinaryTestClasses.TestObjectArrayList())); @@ -1279,6 +1341,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testAssignBinaryObject() { GridBinaryTestClasses.TestObjectContainer container = new GridBinaryTestClasses.TestObjectContainer(); @@ -1293,6 +1356,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testRemoveFromNewObject() { BinaryObjectBuilderImpl wrapper = newWrapper(GridBinaryTestClasses.TestObjectAllTypes.class); @@ -1306,6 +1370,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testRemoveFromExistingObject() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); obj.setDefaultData(); @@ -1320,6 +1385,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * */ + @Test public void testCyclicArrays() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -1341,6 +1407,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes * */ @SuppressWarnings("TypeMayBeWeakened") + @Test public void testCyclicArrayList() { GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer(); @@ -1362,6 +1429,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * @throws Exception If failed. */ + @Test public void testSameBinaryKey() throws Exception { IgniteCache<BinaryObject, BinaryObject> replicatedCache = jcache(0).withKeepBinary(); @@ -1389,6 +1457,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * Ensure that object w/o schema can be re-built. */ + @Test public void testBuildFromObjectWithoutSchema() { BinaryObjectBuilderImpl binBuilder = wrap(new GridBinaryTestClass2()); @@ -1438,6 +1507,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * Check that correct type is stored in binary object. */ + @Test public void testCollectionsSerialization() { final BinaryObjectBuilder root = newWrapper(BigInteger.class); @@ -1519,6 +1589,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes * * @throws Exception If failed. */ + @Test public void testBuilderExternalizable() throws Exception { BinaryObjectBuilder builder = newWrapper("TestType"); @@ -1554,6 +1625,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes * * @throws Exception If failed. */ + @Test public void testEnum() throws Exception { BinaryObjectBuilder builder = newWrapper("TestType"); @@ -1577,6 +1649,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * Test {@link BinaryObjectBuilder#build()} adds type mapping to the binary marshaller's cache. */ + @Test public void testMarshallerMappings() throws IgniteCheckedException, ClassNotFoundException { String typeName = "TestType"; @@ -1611,6 +1684,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes /** * @throws Exception If fails */ + @Test public void testBuilderReusage() throws Exception { // Check: rewrite null field value. BinaryObjectBuilder builder = newWrapper("SimpleCls1"); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderDefaultMappersSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderDefaultMappersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderDefaultMappersSelfTest.java index 3066993..382687c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderDefaultMappersSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderDefaultMappersSelfTest.java @@ -46,12 +46,16 @@ import org.apache.ignite.internal.util.GridUnsafe; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.internal.util.GridUnsafe.BIG_ENDIAN; /** * Binary builder test. */ +@RunWith(JUnit4.class) public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstractTest { /** */ private static IgniteConfiguration cfg; @@ -110,6 +114,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * */ + @Test public void testAllFieldsSerialization() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); obj.setDefaultData(); @@ -123,6 +128,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testNullField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -151,6 +157,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testByteField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -167,6 +174,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testShortField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -183,6 +191,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testIntField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -199,6 +208,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testLongField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -215,6 +225,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testFloatField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -231,6 +242,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testDoubleField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -247,6 +259,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testCharField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -280,6 +293,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testBooleanField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -296,6 +310,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testDecimalField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -312,6 +327,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testStringField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -328,6 +344,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testDateField() throws Exception { Date date = new Date(); @@ -337,6 +354,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testTimestampField() throws Exception { Timestamp ts = new Timestamp(new Date().getTime()); ts.setNanos(1000); @@ -347,6 +365,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testUuidField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -365,6 +384,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testByteArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -381,6 +401,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testShortArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -397,6 +418,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testIntArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -413,6 +435,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testLongArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -429,6 +452,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testFloatArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -445,6 +469,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testDoubleArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -461,6 +486,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testCharArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -477,6 +503,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testBooleanArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -498,6 +525,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testDecimalArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -514,6 +542,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testStringArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -530,6 +559,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testDateArrayField() throws Exception { Date date1 = new Date(); Date date2 = new Date(date1.getTime() + 1000); @@ -542,6 +572,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testTimestampArrayField() throws Exception { Timestamp ts1 = new Timestamp(new Date().getTime()); Timestamp ts2 = new Timestamp(new Date().getTime() + 1000); @@ -557,6 +588,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testUuidArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -575,6 +607,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testObjectField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -591,6 +624,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testObjectArrayField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -612,6 +646,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testCollectionField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -639,6 +674,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testMapField() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -670,6 +706,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testSeveralFields() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -700,6 +737,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testOffheapBinary() throws Exception { BinaryObjectBuilder builder = builder("Class"); @@ -760,6 +798,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testBuildAndDeserialize() throws Exception { BinaryObjectBuilder builder = builder(Value.class.getName()); @@ -776,6 +815,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testMetaData2() throws Exception { BinaryObjectBuilder builder = builder("org.test.MetaTest2"); @@ -805,6 +845,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testMetaData() throws Exception { BinaryObjectBuilder builder = builder("org.test.MetaTest"); @@ -854,6 +895,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * */ + @Test public void testGetFromCopiedObj() { BinaryObject objStr = builder(GridBinaryTestClasses.TestObjectAllTypes.class.getName()).setField("str", "aaa").build(); @@ -871,6 +913,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac * */ @SuppressWarnings("unchecked") + @Test public void testCopyFromInnerObjects() { ArrayList<Object> list = new ArrayList<>(); list.add(new GridBinaryTestClasses.TestObjectAllTypes()); @@ -895,6 +938,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * */ + @Test public void testSetBinaryObject() { // Prepare marshaller context. CacheObjectBinaryProcessorImpl proc = ((CacheObjectBinaryProcessorImpl)(grid(0)).context().cacheObjects()); @@ -914,6 +958,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * */ + @Test public void testPlainBinaryObjectCopyFrom() { GridBinaryTestClasses.TestObjectPlainBinary obj = new GridBinaryTestClasses.TestObjectPlainBinary(toBinary(new GridBinaryTestClasses.TestObjectAllTypes())); @@ -927,6 +972,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * */ + @Test public void testRemoveFromNewObject() { BinaryObjectBuilder builder = builder(GridBinaryTestClasses.TestObjectAllTypes.class.getName()); @@ -940,6 +986,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * */ + @Test public void testRemoveFromExistingObject() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); obj.setDefaultData(); @@ -959,6 +1006,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * */ + @Test public void testRemoveFromExistingObjectAfterGet() { GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes(); obj.setDefaultData(); @@ -976,6 +1024,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac /** * @throws IgniteCheckedException If any error occurs. */ + @Test public void testDontBrokeCyclicDependency() throws IgniteCheckedException { GridBinaryTestClasses.TestObjectOuter outer = new GridBinaryTestClasses.TestObjectOuter(); outer.inner = new GridBinaryTestClasses.TestObjectInner(); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectExceptionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectExceptionSelfTest.java index 6e1b4a3..4d2d719 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectExceptionSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectExceptionSelfTest.java @@ -35,10 +35,14 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * BinaryObjectExceptionSelfTest */ +@RunWith(JUnit4.class) public class BinaryObjectExceptionSelfTest extends GridCommonAbstractTest { /** */ private static final String TEST_KEY = "test_key"; @@ -86,6 +90,7 @@ public class BinaryObjectExceptionSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testUnexpectedFieldType() throws Exception { IgniteEx grid = grid(0); @@ -156,6 +161,7 @@ public class BinaryObjectExceptionSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testFailedMarshallingLogging() throws Exception { BinaryMarshaller marshaller = createStandaloneBinaryMarshaller(); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectToStringSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectToStringSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectToStringSelfTest.java index e208daa..deb20e3 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectToStringSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectToStringSelfTest.java @@ -27,10 +27,14 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for {@code BinaryObject.toString()}. */ +@RunWith(JUnit4.class) public class BinaryObjectToStringSelfTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -59,6 +63,7 @@ public class BinaryObjectToStringSelfTest extends GridCommonAbstractTest { * @throws Exception If failed. */ @SuppressWarnings("unchecked") + @Test public void testToString() throws Exception { MyObject obj = new MyObject(); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectTypeCompatibilityTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectTypeCompatibilityTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectTypeCompatibilityTest.java index 3ef4a83..423c3d1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectTypeCompatibilityTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectTypeCompatibilityTest.java @@ -41,10 +41,14 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * */ +@RunWith(JUnit4.class) public class BinaryObjectTypeCompatibilityTest extends GridCommonAbstractTest { /** Ip finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -69,6 +73,7 @@ public class BinaryObjectTypeCompatibilityTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + @Test public void testCompatibilityWithObject() throws Exception { Ignite ignite = startGrid(); http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/binary/BinarySerialiedFieldComparatorSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinarySerialiedFieldComparatorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinarySerialiedFieldComparatorSelfTest.java index 1e0c5c9..d01fd8b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinarySerialiedFieldComparatorSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinarySerialiedFieldComparatorSelfTest.java @@ -30,10 +30,14 @@ import java.util.Date; import java.util.Set; import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Unit tests for serialized field comparer. */ +@RunWith(JUnit4.class) public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTest { /** Type counter. */ private static final AtomicInteger TYPE_CTR = new AtomicInteger(); @@ -80,6 +84,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testByte() throws Exception { checkTwoValues((byte)1, (byte)2); } @@ -89,6 +94,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testBoolean() throws Exception { checkTwoValues(true, false); } @@ -98,6 +104,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testShort() throws Exception { checkTwoValues((short)1, (short)2); } @@ -107,6 +114,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testChar() throws Exception { checkTwoValues('a', 'b'); } @@ -116,6 +124,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testInt() throws Exception { checkTwoValues(1, 2); } @@ -125,6 +134,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testLong() throws Exception { checkTwoValues(1L, 2L); } @@ -134,6 +144,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testFloat() throws Exception { checkTwoValues(1.0f, 2.0f); } @@ -143,6 +154,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testDouble() throws Exception { checkTwoValues(1.0d, 2.0d); } @@ -152,6 +164,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testString() throws Exception { checkTwoValues("str1", "str2"); } @@ -161,6 +174,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testDate() throws Exception { long time = System.currentTimeMillis(); @@ -172,6 +186,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testTimestamp() throws Exception { long time = System.currentTimeMillis(); @@ -183,6 +198,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testUuid() throws Exception { checkTwoValues(UUID.randomUUID(), UUID.randomUUID()); } @@ -192,6 +208,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testDecimal() throws Exception { checkTwoValues(new BigDecimal("12.3E+7"), new BigDecimal("12.4E+7")); checkTwoValues(new BigDecimal("12.3E+7"), new BigDecimal("12.3E+8")); @@ -202,6 +219,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testInnerObject() throws Exception { checkTwoValues(new InnerClass(1), new InnerClass(2)); } @@ -211,6 +229,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testByteArray() throws Exception { checkTwoValues(new byte[] { 1, 2 }, new byte[] { 1, 3 }); checkTwoValues(new byte[] { 1, 2 }, new byte[] { 1 }); @@ -223,6 +242,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testBooleanArray() throws Exception { checkTwoValues(new boolean[] { true, false }, new boolean[] { false, true }); checkTwoValues(new boolean[] { true, false }, new boolean[] { true }); @@ -235,6 +255,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testShortArray() throws Exception { checkTwoValues(new short[] { 1, 2 }, new short[] { 1, 3 }); checkTwoValues(new short[] { 1, 2 }, new short[] { 1 }); @@ -247,6 +268,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testCharArray() throws Exception { checkTwoValues(new char[] { 1, 2 }, new char[] { 1, 3 }); checkTwoValues(new char[] { 1, 2 }, new char[] { 1 }); @@ -259,6 +281,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testIntArray() throws Exception { checkTwoValues(new int[] { 1, 2 }, new int[] { 1, 3 }); checkTwoValues(new int[] { 1, 2 }, new int[] { 1 }); @@ -271,6 +294,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testLongArray() throws Exception { checkTwoValues(new long[] { 1, 2 }, new long[] { 1, 3 }); checkTwoValues(new long[] { 1, 2 }, new long[] { 1 }); @@ -283,6 +307,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testFloatArray() throws Exception { checkTwoValues(new float[] { 1.0f, 2.0f }, new float[] { 1.0f, 3.0f }); checkTwoValues(new float[] { 1.0f, 2.0f }, new float[] { 1.0f }); @@ -295,6 +320,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testDoubleArray() throws Exception { checkTwoValues(new double[] { 1.0d, 2.0d }, new double[] { 1.0d, 3.0d }); checkTwoValues(new double[] { 1.0d, 2.0d }, new double[] { 1.0d }); @@ -307,6 +333,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testStringArray() throws Exception { checkTwoValues(new String[] { "a", "b" }, new String[] { "a", "c" }); checkTwoValues(new String[] { "a", "b" }, new String[] { "a" }); @@ -319,6 +346,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testDateArray() throws Exception { long curTime = System.currentTimeMillis(); @@ -337,6 +365,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testTimestampArray() throws Exception { long curTime = System.currentTimeMillis(); @@ -355,6 +384,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testUuidArray() throws Exception { UUID v1 = UUID.randomUUID(); UUID v2 = UUID.randomUUID(); @@ -371,6 +401,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testDecimalArray() throws Exception { BigDecimal v1 = new BigDecimal("12.3E+7"); BigDecimal v2 = new BigDecimal("12.4E+7"); @@ -395,6 +426,7 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe * * @throws Exception If failed. */ + @Test public void testInnerObjectArray() throws Exception { InnerClass v1 = new InnerClass(1); InnerClass v2 = new InnerClass(2); @@ -558,4 +590,4 @@ public class BinarySerialiedFieldComparatorSelfTest extends GridCommonAbstractTe this.val = val; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0544d46/modules/core/src/test/java/org/apache/ignite/internal/binary/BinarySimpleNameTestPropertySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinarySimpleNameTestPropertySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinarySimpleNameTestPropertySelfTest.java index b9077d1..d02fb95 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinarySimpleNameTestPropertySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinarySimpleNameTestPropertySelfTest.java @@ -24,6 +24,9 @@ import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.marshaller.jdk.JdkMarshaller; import org.apache.ignite.testframework.config.GridTestProperties; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.testframework.config.GridTestProperties.BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER; import static org.apache.ignite.testframework.config.GridTestProperties.MARSH_CLASS_NAME; @@ -31,6 +34,7 @@ import static org.apache.ignite.testframework.config.GridTestProperties.MARSH_CL /** * Tests testing framewrok, epecially BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER test property. */ +@RunWith(JUnit4.class) public class BinarySimpleNameTestPropertySelfTest extends GridCommonAbstractTest { /** * flag for facade disabled test. As we use binary marshaller by default al @@ -55,6 +59,7 @@ public class BinarySimpleNameTestPropertySelfTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testPropertyEnabled() throws Exception { String useSimpleNameBackup = GridTestProperties.getProperty(BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER); @@ -72,6 +77,7 @@ public class BinarySimpleNameTestPropertySelfTest extends GridCommonAbstractTest /** * @throws Exception If failed. */ + @Test public void testPropertyDisabled() throws Exception { checkProperty("org.ignite.test.TestClass"); } @@ -80,6 +86,7 @@ public class BinarySimpleNameTestPropertySelfTest extends GridCommonAbstractTest * Check if Binary facade is disabled test. Test uses JDK marshaller to provide warranty facade is not available * @throws Exception If failed. */ + @Test public void testBinaryDisabled() throws Exception { enableJdkMarshaller = true; assertNull(startGrid().binary());
