assertNotNull(pojo); assertEquals(value1, pojo.getValue1()); assertEquals(value2, pojo.getValue2()); assertEquals(c1.get(Calendar.DAY_OF_YEAR), c2.get(Calendar.DAY_OF_YEAR)); assertEquals(c1.get(Calendar.YEAR), c2.get(Calendar.YEAR)); assertEquals(c1.get(Calendar.MONTH), c2.get(Calendar.MONTH)); assertEquals(count, cache.size()); fail();
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { super.afterTest(); stopAllGrids(); cleanPersistenceDir(); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { testFailed.set(false); cleanPersistenceDir(); try { Connection conn = DriverManager.getConnection(DFLT_CONN_URL, "sa", ""); Statement stmt = conn.createStatement(); stmt.executeUpdate("DROP TABLE IF EXISTS TEST_CACHE"); stmt.executeUpdate("CREATE TABLE TEST_CACHE (" + " VALUE2 INTEGER PRIMARY KEY," + " VALUE1 VARCHAR(50)," + " VALUE3 DATE" + ")" ); conn.commit(); U.closeQuiet(stmt); U.closeQuiet(conn); } catch (SQLException ex) { fail(ex.getMessage()); } super.beforeTest(); }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); //Data Storage cfg.setDataStorageConfiguration(getDataStorageConfiguration()); //cache configuration CacheConfiguration ccfg = getCacheConfiguration(); if (isHangOnWriteAll) ccfg.setCacheStoreFactory(getStoreFactoryWithHangWriteAll()); else ccfg.setCacheStoreFactory(getStoreFactory()); cfg.setCacheConfiguration(ccfg); //discovery TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi(); TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder = new TcpDiscoveryVmIpFinder(); ArrayList<String> addrs = new ArrayList<>(); addrs.add("127.0.0.1:47500..47509"); tcpDiscoveryVmIpFinder.setAddresses(addrs); tcpDiscoverySpi.setIpFinder(tcpDiscoveryVmIpFinder); cfg.setDiscoverySpi(tcpDiscoverySpi); return cfg; }
Ignite ignite = startGrid(0); IgniteCache<Integer, TestPojo> cache = grid(0).cache("TEST_CACHE"); assertFalse(testFailed.get());
/** */ public CacheJdbcPojoStoreFactory getStoreFactory() { CacheJdbcPojoStoreFactory storeFactory = new CacheJdbcPojoStoreFactory(); storeFactory.setParallelLoadCacheMinimumThreshold(100); storeFactory.setBatchSize(100); storeFactory.setMaximumPoolSize(4); storeFactory.setDataSourceFactory(getDataSourceFactory()); storeFactory.setDialect(new H2Dialect()); storeFactory.setTypes(getJdbcType()); return storeFactory; }
Ignite ignite = startGrid(0); IgniteCache<Integer, TestPojo> cache = grid(0).cache("TEST_CACHE"); assertFalse(testFailed.get());
/** */ public CacheJdbcPojoStoreFactory getStoreFactoryWithHangWriteAll() { TestJdbcPojoStoreFactoryWithHangWriteAll storeFactory = new TestJdbcPojoStoreFactoryWithHangWriteAll(); storeFactory.setParallelLoadCacheMinimumThreshold(100); storeFactory.setBatchSize(100); storeFactory.setMaximumPoolSize(4); storeFactory.setDataSourceFactory(getDataSourceFactory()); storeFactory.setDialect(new H2Dialect()); storeFactory.setTypes(getJdbcType()); return storeFactory; }