public void testNoPidFile() { assertEquals(mysqldResource.pid(), "No PID"); startMysql("pid file"); assertTrue(Integer.parseInt(mysqldResource.pid()) > 0); }
public void testNoPidFile() { assertEquals(mysqldResource.pid(), "No PID"); startMysql("pid file"); assertTrue(Integer.parseInt(mysqldResource.pid()) > 0); }
public void testForceKill() { startMysql("killMe"); assertTrue(mysqldResource.isRunning()); mysqldResource.issueForceKill(); assertFalse(mysqldResource.isRunning()); }
public void testForceKill() { startMysql("killMe"); assertTrue(mysqldResource.isRunning()); mysqldResource.issueForceKill(); assertFalse(mysqldResource.isRunning()); }
public void testCanConnectToServer() { assertFalse(mysqldResource.canConnectToServer(testUtil.testPort(), 1)); startMysql("testCanConnectToServer"); assertTrue(mysqldResource.canConnectToServer(testUtil.testPort(), 1)); }
public void testDestroyShell() { /** TODO: improve this test */ startMysql("DestroyMe"); assertTrue(mysqldResource.isRunning()); mysqldResource.destroyShell(); if (mysqldResource.isRunning()) { new MysqldResource(fileUtil.nullFile()).shutdown(); } }
public void testDestroyShell() { /** TODO: improve this test */ startMysql("DestroyMe"); assertTrue(mysqldResource.isRunning()); mysqldResource.destroyShell(); if (mysqldResource.isRunning()) { new MysqldResource(fileUtil.nullFile()).shutdown(); } }
public void testUseDatabase() throws Exception { String url = "jdbc:mysql://localhost:" + testUtil.testPort() + "/test"; String threadName = "testLaunch"; assertFalse("mysqld should not be running", mysqldResource.isRunning()); startMysql(threadName); Shell s1 = mysqldResource.getShell(); /* this asserts the thread starts */ assertRunning(); /* pause for mysqld to bind to port */ for (int i = 0; i < 100 && !mysqldResource.isReadyForConnections(); i++) { utils.threads().pause(25); } testUtil.assertConnectViaJDBC(url); if (!mysqldResource.isWindows()) { File sockFile = new File(mysqldResource.getDataDir(), "mysql.sock"); assertTrue(sockFile.exists()); } mysqldResource.start(threadName, new HashMap()); Shell s2 = mysqldResource.getShell(); assertEquals(s1, s2); assertTrue(s1.isDaemon()); assertRunningThenShutdown(); }
public void testUseDatabase() throws Exception { String url = "jdbc:mysql://localhost:" + testUtil.testPort() + "/test"; String threadName = "testLaunch"; assertFalse("mysqld should not be running", mysqldResource.isRunning()); startMysql(threadName); Shell s1 = mysqldResource.getShell(); /* this asserts the thread starts */ assertRunning(); /* pause for mysqld to bind to port */ for (int i = 0; i < 100 && !mysqldResource.isReadyForConnections(); i++) { threads.pause(25); } testUtil.assertConnectViaJDBC(url); mysqldResource.start(threadName, new HashMap()); Shell s2 = mysqldResource.getShell(); assertEquals(s1, s2); assertTrue(s1.isDaemon()); assertRunningThenShutdown(); }