@Override protected void setUp() { str = new Str(); }
protected void setUp() { str = new Str(); }
public Process exec(String[] cmdarray, String[] envp, File dir) throws IOException { Object[] params = new Object[] { cmdarray, envp, dir }; String msg = new Str().toString(params); throw new IOException("Not implemented: " + msg); }
public void assertContainsIgnoreCase(String searchIn, String searchFor) { if (new Str().containsIgnoreCase(searchIn, searchFor)) { return; } String msg = "<" + searchFor + "> not found in <" + searchIn + ">"; throw new AssertionFailedError(msg); }
public void assertContainsIgnoreCase(String searchIn, String searchFor) { if (new Str().containsIgnoreCase(searchIn, searchFor)) { return; } String msg = "<" + searchFor + "> not found in <" + searchIn + ">"; throw new AssertionFailedError(msg); }
public void start(String threadName, Map mysqldArgs) { if (running != null) { Str str = new Str(); String msg = "already running " + running + " mysqldArgs: " + str.toString(mysqldArgs.entrySet()); throw new RuntimeException(msg); } currentOptions.putAll(mysqldArgs); running = threadName; }
public NotImplementedException(Object[] arg0) { this(new Str().toString(arg0)); }
public static void shutdown(String hostColonPort, PrintStream out) { synchronized (startedMysqlds) { Object obj = startedMysqlds.get(hostColonPort); MysqldResourceI mysqld = (MysqldResourceI) obj; if (mysqld != null) { startedMysqlds.remove(hostColonPort); mysqld.shutdown(); } else { String list = new Str().toString(startedMysqlds.keySet()); out.println("mysqld [" + hostColonPort + "] not found in " + list); } } } }
public void testKillCommandLineUnix() { FileUtil fu = new FileUtil() { public boolean isWindows() { return false; } }; String pid = "2342"; ProcessUtil kp = new ProcessUtil(fu, pid, null, null, new Str(), null, null, null); String[] args = kp.killArgs(false); assertEquals(args[0], "kill"); assertEquals(pid, args[args.length - 1]); }
private void checkVersion(String version) throws SQLException { stmt = conn.createStatement(); rs = stmt.executeQuery("SELECT VERSION()"); int cols = rs.getMetaData().getColumnCount(); assertTrue(rs.next()); assertTrue(cols >= 1); String searchIn = rs.getString(1); assertTrue("<" + version + "> not found in <" + searchIn + ">", new Str().containsIgnoreCase(searchIn, version)); assertEquals(cols, 1); assertFalse(rs.next()); rs.close(); stmt.close(); }
public void testKillCommandLineWindows() { FileUtil fu = new FileUtil() { public boolean isWindows() { return true; } }; String pid = "2342"; ProcessUtil kp = new ProcessUtil(fu, pid, null, null, new Str(), null, new Streams(), null); String[] args = kp.killArgs(false); assertTrue(args[0], args[0].endsWith("kill.exe")); assertEquals(pid, args[args.length - 1]); }
public Utils() { this.shellFactory = new Shell.Factory(); this.str = new Str(); this.streams = new Streams(); this.threads = new Threads(); this.files = new Files(shellFactory, File.separatorChar, streams); }
private void checkVersion(String version) { QueryUtil util = new QueryUtil(conn); String searchIn = util.queryForString("SELECT VERSION()"); assertTrue("<" + version + "> not found in <" + searchIn + ">", new Str().containsIgnoreCase(searchIn, version)); }
public Utils() { this.shellFactory = new Shell.Factory(); this.str = new Str(); this.streams = new Streams(); this.threads = new Threads(); this.files = new Files(shellFactory, File.separatorChar, streams); }
public ProcessUtil(String pid, PrintStream out, PrintStream err) { this(new FileUtil(), pid, out, err, new Str(), new Shell.Factory(), new Streams(), new Threads()); }
public MysqldResource(File baseDir, PrintStream out, PrintStream err) { this(baseDir, out, err, new FileUtil(), new Shell.Factory(), new Streams(), new Threads(), new Str(), new ClassUtil()); }
protected void setUp() { super.setUp(); testUtil = new TestUtil(); fileUtil = new TestFileUtil(); utils = new Utils(fileUtil, new Shell.Factory(), new Streams(), new Threads(), new Str()); baseDir = new File(fileUtil.testDir(), "MRTest"); dataDir = new File(baseDir, "data"); fileUtil.deleteTree(baseDir); if (baseDir.exists()) { warn("residual files"); } mysqldResource = new MysqldResource(baseDir, dataDir, null, System.out, System.err, utils); mysqldResource.setKillDelay(testUtil.testKillDelay()); }
public void testToString() throws Exception { Str str = new Str(); assertEquals("[foo]", str.toString(new Object[] { "foo" })); assertEquals("[foo][bar]", str.toString(new Object[] { "foo", "bar" })); Object[] objects = new Object[] { "foo", new Object[] { "bar", "baz" }, "wiz" }; assertEquals("[foo][[bar][baz]][wiz]", str.toString(objects)); objects = new Object[] { "foo", Arrays.asList(new Object[] { "bar", "baz" }), "wiz" }; assertEquals("[foo][[bar][baz]][wiz]", str.toString(objects)); } }
public void testContainsIgnoreCase() throws Exception { Str str = new Str(); assertTrue(str.containsIgnoreCase("foobarbaz", "bar")); assertTrue(str.containsIgnoreCase("foobarbaz", "BAR")); assertTrue(str.containsIgnoreCase("fooBARbaz", "bar")); assertFalse(str.containsIgnoreCase("foobarbaz", "whiz")); }