/** * @throws Exception If failed. */ @Test public void testFullName() throws Exception { BinaryBasicNameMapper mapper = new BinaryBasicNameMapper(false); assertEquals(GridBinaryTestClass1.class.getName(), mapper.typeName(GridBinaryTestClass1.class.getName())); assertEquals(GridBinaryTestClass1.class.getName() + "$InnerClass", mapper.typeName(GridBinaryTestClass1.class.getName() + "$InnerClass")); } }
/** * @throws Exception If failed. */ @Test public void testOverrideNameMapperSimpleNameMapper() throws Exception { checkOverrideNameMapper(new BinaryBasicNameMapper(true), new BinaryBasicIdMapper(true)); }
/** * @throws Exception If failed. */ @Test public void testClassNamesJarFullNameMapper() throws Exception { checkClassNamesJar(new BinaryBasicNameMapper(false), new BinaryBasicIdMapper(false)); }
/** * @throws Exception If failed. */ @Test public void testClassNamesJarSimpleNameMapper() throws Exception { checkClassNamesJar(new BinaryBasicNameMapper(true), new BinaryBasicIdMapper(true)); }
/** * @throws Exception If failed. */ @Test public void testClassNamesSimpleNameMapper() throws Exception { checkClassNames(new BinaryBasicNameMapper(true), new BinaryBasicIdMapper(true)); }
/** * @throws Exception If failed. */ @Test public void testTypeConfigurationsFullNameIdMapper() throws Exception { checkTypeConfigurations(new BinaryBasicNameMapper(false), new BinaryBasicIdMapper(false)); }
/** * @throws Exception If failed. */ @Test public void testClassNamesFullNameMapper() throws Exception { checkClassNames(new BinaryBasicNameMapper(false), new BinaryBasicIdMapper(false)); }
/** * @throws Exception If failed. */ @Test public void testClassNamesMixedMappers() throws Exception { checkClassNames(new BinaryBasicNameMapper(false), new BinaryBasicIdMapper(true)); }
/** * @throws Exception If failed. */ @Test public void testTypeConfigurationsJarSimpleNameMapper() throws Exception { checkTypeConfigurationJar(new BinaryBasicNameMapper(true), new BinaryBasicIdMapper(true)); }
/** * @throws Exception If failed. */ @Test public void testOverrideJarFullNameMapper() throws Exception { checkOverrideJar(new BinaryBasicNameMapper(false), new BinaryBasicIdMapper(false)); }
/** * @throws Exception If failed. */ @Test public void testTypeConfigurationsSimpleNameIdMapper() throws Exception { checkTypeConfigurations(new BinaryBasicNameMapper(true), new BinaryBasicIdMapper(true)); }
/** * @throws Exception If failed. */ @Test public void testOverrideIdMapperFullNameMapper() throws Exception { checkOverrideNameMapper(new BinaryBasicNameMapper(false), new BinaryBasicIdMapper(false)); }
/** * @throws Exception If failed. */ @Test public void testSimpleName() throws Exception { BinaryBasicNameMapper mapper = new BinaryBasicNameMapper(true); assertEquals("GridBinaryTestClass1", mapper.typeName(GridBinaryTestClass1.class.getName())); assertEquals("InnerClass", mapper.typeName(GridBinaryTestClass1.class.getName() + "$InnerClass")); }
/** * @throws Exception If failed. */ @Test public void testOverrideIdMapperSimpleNameMapper() throws Exception { checkOverrideNameMapper(new BinaryBasicNameMapper(true), new BinaryBasicIdMapper(true)); }
/** * @throws Exception If failed. */ @Test public void testTypeConfigurationsJarFullNameMapper() throws Exception { checkTypeConfigurationJar(new BinaryBasicNameMapper(false), new BinaryBasicIdMapper(false)); }
/** * @throws Exception If failed. */ @Test public void testOverrideJarSimpleNameMapper() throws Exception { checkOverrideJar(new BinaryBasicNameMapper(true), new BinaryBasicIdMapper(true)); }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); BinaryConfiguration bCfg = cfg.getBinaryConfiguration(); bCfg.setIdMapper(new BinaryBasicIdMapper(true)); bCfg.setNameMapper(new BinaryBasicNameMapper(true)); return cfg; } }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); BinaryConfiguration bCfg = cfg.getBinaryConfiguration(); bCfg.setNameMapper(new BinaryBasicNameMapper()); bCfg.setIdMapper(new BinaryBasicIdMapper(true)); return cfg; } }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); BinaryConfiguration bCfg = cfg.getBinaryConfiguration(); bCfg.setNameMapper(new BinaryBasicNameMapper()); bCfg.setIdMapper(new BinaryBasicIdMapper(true)); return cfg; } }
/** * @throws Exception If failed. */ @Test public void testDuplicateNameFullNameMapper() throws Exception { BinaryMarshaller marsh = binaryMarshaller(new BinaryBasicNameMapper(false), new BinaryBasicIdMapper(false), null, null, null); Test1.Job job1 = new Test1().new Job(); Test2.Job job2 = new Test2().new Job(); marsh.marshal(job1); marsh.marshal(job2); }