public void testGetMysqldLinux() { setSytemPropertiesToLinux(); checkMysqldFile(); assertTrue(fileUtil.madeExecutable(mysqldResource .getMysqldFilePointer())); }
public void testDestroyShell() { /** TODO: improve this test */ startMysql("DestroyMe"); assertTrue(mysqldResource.isRunning()); mysqldResource.destroyShell(); if (mysqldResource.isRunning()) { new MysqldResource(fileUtil.nullFile()).shutdown(); } }
public void testForceKill() { startMysql("killMe"); assertTrue(mysqldResource.isRunning()); mysqldResource.issueForceKill(); assertFalse(mysqldResource.isRunning()); }
private void assertRunningThenShutdown() { assertRunning(); mysqldResource.shutdown(); assertNotRunning(); }
public void testJarName() { setSystemPropertiesToWinNT(); assertEquals("win_share_dir.jar", mysqldResource.shareJar()); setSytemPropertiesToLinux(); assertEquals("share_dir.jar", mysqldResource.shareJar()); }
private void setSystemPropertiesToWinNT() { mysqldResource.setOsAndArch("Windows NT", "x86"); assertTrue(mysqldResource.isWindows()); }
private void setSytemPropertiesToLinux() { mysqldResource.setOsAndArch("Linux", "i386"); assertFalse(mysqldResource.isWindows()); }
public void testVersion() { assertEquals(MysqldResourceI.DEFAULT_VERSION, mysqldResource .getVersion()); mysqldResource.setVersion(5, 11, 42); assertEquals("5.11.42", mysqldResource.getVersion()); }
/** * Starts mysqld passing it the parameters specified in the arguments map. * No effect if MySQL is already running */ public synchronized void start(String threadName, Map mysqldArgs) { start(threadName, mysqldArgs, false); }
/** * Directs output generated by MySQL to Standard Out and Standard Error. * This is the constructor included in the MBeanInfo. */ public SimpleMysqldDynamicMBean() { this(new MysqldResource()); }
String getResourceName() { String dir = osName + "-" + osArch; String name = executableName(); return getVersionDir() + Streams.RESOURCE_SEPARATOR + dir + Streams.RESOURCE_SEPARATOR + name; }
String shareJar() { String shareJar = "share_dir.jar"; if (isWindows()) { shareJar = "win_" + shareJar; } return shareJar; }
/** * Directs output generated by MySQL to Standard Out and Standard Error. * This is the constructor included in the MBeanInfo. */ public SimpleMysqldDynamicMBean() { this(new MysqldFactory.Default()); }
public Map getCurrentOptions(final MysqldResource mysqldResource, final Map params) { return (Map) new Exceptions.Block() { public Object inner() throws Exception { return getOptionsFromHelp(mysqldResource, params); } }.exec(); } }
public void testDestroyShell() { /** TODO: improve this test */ startMysql("DestroyMe"); assertTrue(mysqldResource.isRunning()); mysqldResource.destroyShell(); if (mysqldResource.isRunning()) { new MysqldResource(fileUtil.nullFile()).shutdown(); } }
public void testForceKill() { startMysql("killMe"); assertTrue(mysqldResource.isRunning()); mysqldResource.issueForceKill(); assertFalse(mysqldResource.isRunning()); }
public void testGetMysqldLinux() { setSytemPropertiesToLinux(); checkMysqldFile(); assertTrue(fileUtil.madeExecutable(mysqldResource .getMysqldFilePointer())); }
private void assertRunningThenShutdown() { assertRunning(); mysqldResource.shutdown(); assertNotRunning(); }
private void setSystemPropertiesToWinNT() { mysqldResource.setOsAndArch("Windows NT", "x86"); assertTrue(mysqldResource.isWindows()); }
private void setSytemPropertiesToLinux() { mysqldResource.setOsAndArch("Linux", "i386"); assertFalse(mysqldResource.isWindows()); }