/** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, marshallerBackup); }
/** */ @BeforeClass public static void init() { GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName()); GridTestProperties.setProperty(GridTestProperties.BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER, "true"); } }
/** */ @BeforeClass public static void init() { GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName()); GridTestProperties.setProperty(GridTestProperties.BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER, "true"); } }
/** */ @BeforeClass public static void init() { GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName()); GridTestProperties.setProperty(GridTestProperties.BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER, "true"); } }
/** */ @BeforeClass public static void init() { GridTestProperties.setProperty(GridTestProperties.BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER, "true"); } }
/** * @throws Exception If failed. */ @Test public void testPropertyEnabled() throws Exception { String useSimpleNameBackup = GridTestProperties.getProperty(BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER); try { GridTestProperties.setProperty(BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER, "true"); checkProperty("TestClass"); } finally { if (useSimpleNameBackup != null) GridTestProperties.setProperty(BINARY_MARSHALLER_USE_SIMPLE_NAME_MAPPER, "true"); } }
/** * @param ignoredTests Tests to ignore. * @return Test suite. */ public static List<Class<?>> suite(Collection<Class> ignoredTests) { GridTestProperties.setProperty(GridTestProperties.ENTRY_PROCESSOR_CLASS_NAME, "org.apache.ignite.tests.p2p.CacheDeploymentBinaryEntryProcessor"); List<Class<?>> suite = new ArrayList<>(IgniteCacheTestSuite3.suite(ignoredTests)); GridTestUtils.addTestIfNeeded(suite, GridCacheBinaryAtomicEntryProcessorDeploymentSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, GridCacheBinaryTransactionalEntryProcessorDeploymentSelfTest.class, ignoredTests); return suite; } }
/** * @param expTypeName Type name. * @throws Exception If failed. */ private void checkProperty(String expTypeName) throws Exception { String marshBackup = GridTestProperties.getProperty(MARSH_CLASS_NAME); try { GridTestProperties.setProperty(MARSH_CLASS_NAME, BinaryMarshaller.class.getName()); IgniteBinary binary = startGrid().binary(); BinaryObjectBuilder builder = binary.builder("org.ignite.test.TestClass"); BinaryObject bObj = builder.build(); assertEquals(expTypeName, bObj.type().typeName()); } finally { if (marshBackup != null) GridTestProperties.setProperty(MARSH_CLASS_NAME, marshBackup); } } }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName()); IgniteConfiguration cfg = super.getConfiguration(gridName); CacheConfiguration<?,?> cache = defaultCacheConfiguration(); cache.setWriteSynchronizationMode(FULL_SYNC); cache.setAtomicityMode(TRANSACTIONAL); cfg.setConnectorConfiguration(new ConnectorConfiguration()); QueryEntity queryEntity = new QueryEntity(); queryEntity.setKeyType("java.lang.String"); queryEntity.setValueType("org.apache.ignite.internal.JdbcTestObject"); queryEntity.addQueryField("id", "java.lang.Integer", null); queryEntity.addQueryField("testObject", "org.apache.ignite.internal.JdbcTestObject2", null); queryEntity.setIndexes(Collections.singletonList(new QueryIndex("id"))); cache.setQueryEntities(Collections.singletonList(queryEntity)); cfg.setCacheConfiguration(cache); return cfg; }