/** * @param path Path to the working directory. * @param consId Consistent ID of the local node. * @return DB storage path. * * @throws IgniteCheckedException If resolving swap directory fails. */ protected File buildPath(String path, String consId) throws IgniteCheckedException { String igniteHomeStr = U.getIgniteHome(); File workDir = igniteHomeStr == null ? new File(path) : U.resolveWorkDirectory(igniteHomeStr, path, false); return new File(workDir, consId); }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { allocationPath = U.resolveWorkDirectory(U.defaultWorkDirectory(), "pagemem", false); }
/** * */ private void cleanIgniteWorkDir() throws IgniteCheckedException { String baseDir = U.defaultWorkDirectory(); File baseDirFile = new File(baseDir); for (File f : baseDirFile.listFiles()) U.delete(U.resolveWorkDirectory(baseDir, f.getName(), false)); }
/** * @param ignite Ignite. * @param cacheName Cache name. * @param partId Partition id. */ private static File partitionFile(Ignite ignite, String cacheName, int partId) throws IgniteCheckedException { File dbDir = U.resolveWorkDirectory(U.defaultWorkDirectory(), DFLT_STORE_DIR, false); String nodeName = ignite.name().replaceAll("\\.", "_"); return new File(dbDir, String.format("%s/cache-%s/part-%d.bin", nodeName, cacheName, partId)); }
/** */ private void cleanPersistenceFiles(String igName) throws Exception { String ig1DbPath = Paths.get(DFLT_STORE_DIR, igName).toString(); File igDbDir = U.resolveWorkDirectory(U.defaultWorkDirectory(), ig1DbPath, false); U.delete(igDbDir); Files.createDirectory(igDbDir.toPath()); String ig1DbWalPath = Paths.get(DFLT_STORE_DIR, "wal", igName).toString(); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), ig1DbWalPath, false)); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); }
/** * Clean up working directory. */ private void cleanUpWorkingDir() throws Exception { String workDir = U.defaultWorkDirectory(); U.delete(U.resolveWorkDirectory(workDir, "marshaller", false)); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); super.beforeTestsStarted(); }
/** * Setup before each test. */ @Before public void beforeEach() throws IgniteCheckedException { U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { stopAllGrids(); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false)); }
/** * @throws Exception If failed. */ private void deleteWorkFiles() throws Exception { cleanPersistenceDir(); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "snapshot", false)); }
/** * @throws Exception If failed. */ private void deleteWorkFiles() throws Exception { cleanPersistenceDir(); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "snapshot", false)); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { stopAllGrids(); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false)); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { stopAllGrids(); cleanPersistenceDir(); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "temp", false)); }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); super.beforeTestsStarted(); // We need to activate cluster. grid(0).cluster().active(true); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); startGrids(NODES_COUNT); grid(0).cluster().active(true); actxDflt = grid(0).context().authentication().authenticate(User.DFAULT_USER_NAME, "ignite"); assertNotNull(actxDflt); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); startGrids(NODES_COUNT); grid(0).cluster().active(true); actxDflt = grid(0).context().authentication().authenticate(User.DFAULT_USER_NAME, "ignite"); assertNotNull(actxDflt); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); startGrids(2); grid(0).cluster().active(true); AuthorizationContext.context(grid(0).context().authentication().authenticate("ignite", "ignite")); grid(0).context().authentication().addUser("another_user", "passwd"); AuthorizationContext.clear(); }