public void testLaunch() throws Exception { Map args = new HashMap(); String port = "" + testUtil.testPort(); args.put(MysqldResourceI.PORT, port); String url = "jdbc:mysql://localhost:" + port + "/test"; String threadName = "testLaunch"; assertFalse("mysqld should not be running", mysqldResource.isRunning()); mysqldResource.start(threadName, args); 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, true); mysqldResource.start(threadName, args); Shell s2 = mysqldResource.getShell(); assertEquals(s1, s2); assertTrue(s1.isDaemon()); assertRunningThenShutdown(); }
public void testLaunch() throws Exception { Map args = new HashMap(); String port = "" + testUtil.testPort(); args.put(MysqldResourceI.PORT, port); String url = "jdbc:mysql://localhost:" + port + "/test"; String threadName = "testLaunch"; assertFalse("mysqld should not be running", mysqldResource.isRunning()); mysqldResource.start(threadName, args); 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, true); mysqldResource.start(threadName, args); 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++) { 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(); }