[Esbox-commits] r1904 - branches/work_Ed/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands

eswartz at garage.maemo.org eswartz at garage.maemo.org
Wed Jul 29 23:28:06 EEST 2009


Author: eswartz
Date: 2009-07-29 23:28:05 +0300 (Wed, 29 Jul 2009)
New Revision: 1904

Modified:
   branches/work_Ed/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java
   branches/work_Ed/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java
Log:
Remove obsolete tests

Modified: branches/work_Ed/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java	2009-07-29 20:25:59 UTC (rev 1903)
+++ branches/work_Ed/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java	2009-07-29 20:28:05 UTC (rev 1904)
@@ -17,14 +17,8 @@
 import org.maemo.esbox.internal.scratchbox.sb1.command.ListCompilersCommand;
 import org.maemo.esbox.internal.scratchbox.sb1.command.ListCputranspCommand;
 import org.maemo.esbox.internal.scratchbox.sb1.command.ListDevkitsCommand;
-import org.maemo.esbox.internal.scratchbox.sb1.command.ListSessionsCommand;
 import org.maemo.esbox.internal.scratchbox.sb1.command.ListTargetsCommand;
-import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
-import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
 import org.maemo.mica.common.core.MicaException;
-import org.maemo.mica.common.core.process.IProcessLauncher;
-import org.maemo.mica.common.core.process.ProcessLauncherParameters;
-import org.maemo.mica.common.core.sdk.ISDKTarget;
 
 /**
  * Please, read file TESTS.txt for more instructions about test.
@@ -226,62 +220,6 @@
 	}
 
 	/**
-	 * This is a broken test because we do not run with PTYs, ever, so no interactive programs
-	 * (or sessions) will launch under scratchbox and stay alive long enough to detect.
-	 * @throws Exception
-	 */
-	public void __dont_testListSessionsCommand() throws Exception {
-		List<String> fakeParam = new ArrayList<String>();
-		fakeParam.add("param");
-
-		int numberOfSessions = 0;
-
-		ListSessionsCommand listSessionsCommand = new ListSessionsCommand(sb1Command);
-		List<String> sessions = null;
-
-		try {
-			listSessionsCommand.performCommand(fakeParam);
-			fail("Invalid number of param");
-		} catch (MicaException e) {
-			// expected
-		}
-
-		sessions = listSessionsCommand.performCommand(new ArrayList<String>());
-
-		// make sure anything here is a pid
-		for (String pid : sessions) {
-			Integer.parseInt(pid);
-		}
-
-		numberOfSessions = sessions.size();
-		
-		// launch a new session (without switching targets!)
-		ISDKTarget target = ScratchboxSDKFacade.getInstance().getScratchboxSDK(Scratchbox1SDK.class).get(0).getCurrentSDKTarget();
-		
-		Process process = null;
-		try {
-			IProcessLauncher launcher = target.getProcessLauncherFactory().createProcessLauncher(
-					ProcessLauncherParameters.create("/usr/bin/yes"));
-			process = launcher.createProcess(null);
-			
-			sessions = listSessionsCommand.performCommand(new ArrayList<String>());
-			
-			// this either launches 1 or 2 processes
-			assertTrue(numberOfSessions < sessions.size());
-	
-			// make sure anything here is a pid
-			for (String pid : sessions) {
-				Integer.parseInt(pid);
-			}
-		} finally {		
-			// kill the shell (exit, then send ctrl-d)
-			process.getOutputStream().write("exit\n004\004\004\004\004\004\004\004\004".getBytes());
-			process.destroy();
-		}
-		
-	}
-
-	/**
 	 * Test method for
 	 * {@link embedded.core.scratchbox.command.ListTargetsCommand#performCommand(java.util.List)}.
 	 */

Modified: branches/work_Ed/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java	2009-07-29 20:25:59 UTC (rev 1903)
+++ branches/work_Ed/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java	2009-07-29 20:28:05 UTC (rev 1904)
@@ -24,9 +24,6 @@
 import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
 import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
 import org.maemo.mica.common.core.MicaException;
-import org.maemo.mica.common.core.process.IProcessLauncher;
-import org.maemo.mica.common.core.process.ProcessLauncherParameters;
-import org.maemo.mica.common.core.sdk.ISDKTarget;
 
 /**
  * Please, read file TESTS.txt for more instructions about test.
@@ -253,62 +250,11 @@
 
 	/**
 	 * Test method for
-	 * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getSessions()}.
+	 * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getDefaultTarget()}.
 	 * 
-	 * This is broken because PTY support is no longer wired up.  Thus, none of the
-	 * simple programs we launch via tests will run for long enough to be detected as a session.
 	 * @throws MicaException
 	 */
 	@Test
-	public void __dont__testGetSessions() throws Exception {
-		if (sdk == null) return;
-		int numberOfSessions = 0;
-
-		List<String> sessions = sdk.getSessions();
-
-		// make sure anything here is a pid
-		for (String pid : sessions) {
-			Integer.parseInt(pid);
-		}
-
-		numberOfSessions = sessions.size();
-		
-		// launch a new session (without switching targets!)
-		ISDKTarget target = ScratchboxSDKFacade.getInstance().getScratchboxSDK(Scratchbox1SDK.class).get(0).getCurrentSDKTarget();
-		Process process = null;
-		try {
-			IProcessLauncher launcher = target.getProcessLauncherFactory().createProcessLauncher(
-					ProcessLauncherParameters.create("bin/sh"));
-			process = launcher.createProcess(null);
-			
-			// wait for it to really start
-			Thread.sleep(5000);
-		
-			sessions = sdk.getSessions();// ScratchboxFacade.getInstance().getSessions(sdk);
-			
-			// this either launches 1 or 2 processes
-			assertTrue(numberOfSessions < sessions.size());
-	
-			// make sure anything here is a pid
-			for (String pid : sessions) {
-				Integer.parseInt(pid);
-			}
-		} catch (Exception e) {
-			fail("Exception: "+e.getMessage());
-		}finally {		
-			// kill the shell (exit, then send ctrl-d)
-			process.getOutputStream().write("exit\n004\004\004\004\004\004\004\004\004".getBytes());
-			process.destroy();
-		}
-	}
-
-	/**
-	 * Test method for
-	 * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getCurrentTarget()}.
-	 * 
-	 * @throws MicaException
-	 */
-	@Test
 	public void testGetCurrentTarget() throws MicaException {
 		if (sdk == null) return;
 		String currentTarget = sdk.getCurrentTarget();//ScratchboxFacade.getInstance().getCurrentTarget(sdk);



More information about the Esbox-commits mailing list