public void closeAndDispose() { scs.closeAndDispose(); }
public void closeAndDispose() { scs.closeAndDispose(); }
public void closeAndDispose() { scs.closeAndDispose(); }
private void closeGivenSCS(SimulationConstructionSet scs) { ThreadTools.sleep(CLOSING_SLEEP_TIME); scs.closeAndDispose(); scs = null; }
@Test// timeout = 30000 public void testSimulationConstructionSetWithoutARobot() { SimulationConstructionSet scs = new SimulationConstructionSet(parameters); Thread thread = new Thread(scs); thread.start(); sleep(pauseTimeForGUIs); scs.closeAndDispose(); }
@After public void cleanUpTest() { if (keepSCSUp) { ThreadTools.sleepForever(); } if (scs != null && !keepSCSUp) scs.closeAndDispose(); ReferenceFrameTools.clearWorldFrameTree(); }
@Test// timeout = 30000 public void testSimulationConstructionSetWithARobot() { Robot robot = new Robot("NullRobot"); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); Thread thread = new Thread(scs); thread.start(); sleep(pauseTimeForGUIs); scs.closeAndDispose(); }
@Test// timeout=300000 public void testRewindableSimulation() throws UnreasonableAccelerationException { SimulationConstructionSet scs1 = constructRewindableSimulationConstructionSet(); SimulationConstructionSet scs2 = constructRewindableSimulationConstructionSet(); ArrayList<String> exceptions = new ArrayList<String>(); // exceptions.add("ticks_till_control"); SimulationRewindabilityVerifier verifier = new SimulationRewindabilityVerifier(scs1, scs2, exceptions); int numTests = 5000; double maxDifferenceAllowed = 1e-12; ArrayList<VariableDifference> variableDifferences = verifier.checkRewindabilityWithSimpleMethod(numTests, maxDifferenceAllowed); assertTrue(variableDifferences.isEmpty()); scs1.closeAndDispose(); scs2.closeAndDispose(); }
@Test// timeout=300000 public void testEasilyDetectableNonRewindableSimulation() throws UnreasonableAccelerationException { SimulationConstructionSet scs1 = constructEasilyDetectableNonRewindableSimulationConstructionSet(); SimulationConstructionSet scs2 = constructEasilyDetectableNonRewindableSimulationConstructionSet(); ArrayList<String> exceptions = new ArrayList<String>(); // exceptions.add("ticks_till_control"); SimulationRewindabilityVerifier verifier = new SimulationRewindabilityVerifier(scs1, scs2, exceptions); int numTests = 5000; double maxDifferenceAllowed = 1e-12; ArrayList<VariableDifference> variableDifferences = verifier.checkRewindabilityWithSimpleMethod(numTests, maxDifferenceAllowed); if (VERBOSE) { System.out.println("\ntestEasilyDetectableNonRewindableSimulation differences:"); System.out.println(VariableDifference.allVariableDifferencesToString(variableDifferences)); } assertEquals(2, variableDifferences.size()); scs1.closeAndDispose(); scs2.closeAndDispose(); }
@Disabled // Throws an EdtViolationException at Runtime. @Test// timeout=300000 public void testEnumDisplay() throws SimulationExceededMaximumTimeException, InterruptedException { SimpleController controller = new SimpleController(); SimulationConstructionSet scs = setupSCS(controller); scs.setupEntryBox("largeEnumVariable"); scs.setupEntryBox("badGreekVariable"); scs.setupEntryBox("smallEnumVariable"); Thread.sleep(10000); scs.closeAndDispose(); }
public void concludeTesting(String videoName) { if (simulationTestingParameters.getKeepSCSUp()) { ThreadTools.sleepForever(); } if (simulationTestingParameters.getCreateSCSVideos()) { BambooTools.createVideoWithDateTimeAndStoreInDefaultDirectory(scs, videoName); } ThreadTools.sleep(200); scs.closeAndDispose(); }
@After public void tearDown() { if (simulationTestingParameters.getKeepSCSUp()) ThreadTools.sleepForever(); if (mainRegistry != null) { mainRegistry.closeAndDispose(); mainRegistry = null; } initializationSucceeded = null; yoGraphicsListRegistry = null; commandInputManager = null; statusOutputManager = null; toolboxController = null; robot = null; toolboxUpdater = null; if (scs != null) { scs.closeAndDispose(); scs = null; } }
@After public void tearDown() { if (simulationTestingParameters.getKeepSCSUp()) ThreadTools.sleepForever(); if (mainRegistry != null) { mainRegistry.closeAndDispose(); mainRegistry = null; } initializationSucceeded = null; yoGraphicsListRegistry = null; commandInputManager = null; toolboxController = null; robot = null; toolboxUpdater = null; blockingSimulationRunner = null; if (scs != null) { scs.closeAndDispose(); scs = null; } ReferenceFrameTools.clearWorldFrameTree(); }
@After public void tearDown() { if (simulationTestingParameters.getKeepSCSUp()) ThreadTools.sleepForever(); if (mainRegistry != null) { mainRegistry.closeAndDispose(); mainRegistry = null; } initializationSucceeded = null; yoGraphicsListRegistry = null; commandInputManager = null; toolboxController = null; robot = null; toolboxUpdater = null; blockingSimulationRunner = null; if (scs != null) { scs.closeAndDispose(); scs = null; } ReferenceFrameTools.clearWorldFrameTree(); }
@After public void tearDown() { if (simulationTestingParameters.getKeepSCSUp()) ThreadTools.sleepForever(); if (mainRegistry != null) { mainRegistry.closeAndDispose(); mainRegistry = null; } initializationSucceeded = null; yoGraphicsListRegistry = null; commandInputManager = null; toolboxController = null; robot = null; toolboxUpdater = null; blockingSimulationRunner = null; if (scs != null) { scs.closeAndDispose(); scs = null; } ReferenceFrameTools.clearWorldFrameTree(); }
private void startSimAndDisplayLink(Link linkToDisplay) { // Robot nullRobot = new Robot("Null"); sim = new SimulationConstructionSet(parameters); sim.addStaticLink(linkToDisplay); // position the camera to view links sim.setCameraPosition(6.0, 6.0, 3.0); sim.setCameraFix(0.5, 0.5, 0.0); sim.setGroundVisible(false); sim.startOnAThread(); ThreadTools.sleep(3000); sim.closeAndDispose(); }
public void concludeTesting(int additionalStackDepthForRelevantCallingMethod) { if (simulationTestingParameters.getKeepSCSUp()) { ThreadTools.sleepForever(); } if (simulationTestingParameters.getCreateSCSVideos()) { BambooTools.createVideoWithDateTimeClassMethodAndShareOnSharedDriveIfAvailable(scs.getRobots()[0].getName(), scs, additionalStackDepthForRelevantCallingMethod + 1); } ThreadTools.sleep(200); scs.closeAndDispose(); }
private void doATestWithJustAnSCS() throws SimulationExceededMaximumTimeException { // BambooTools.reportTestStartedMessage(simulationTestingParameters.getShowWindows()); SimulationConstructionSetParameters simulationConstructionSetParameters = new SimulationConstructionSetParameters(); simulationConstructionSetParameters.setCreateGUI(true); simulationConstructionSetParameters.setShowSplashScreen(false); simulationConstructionSetParameters.setShowWindows(true); SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("TEST"), simulationConstructionSetParameters); scs.startOnAThread(); ThreadTools.sleep(4000); scs.closeAndDispose(); // BambooTools.reportTestFinishedMessage(simulationTestingParameters.getShowWindows()); }
@ContinuousIntegrationTest(estimatedDuration = 9.2) @Test(timeout = 520000) public void testCanRewindAndGoForward() throws UnreasonableAccelerationException { BambooTools.reportTestStartedMessage(simulationTestingParameters.getShowWindows()); int numberOfSteps = 100; SimulationConstructionSet scs = setupScs(); scs.simulateOneRecordStepNow(); scs.simulateOneRecordStepNow(); for (int i = 0; i < numberOfSteps; i++) { scs.simulateOneRecordStepNow(); scs.simulateOneRecordStepNow(); scs.stepBackwardNow(); } scs.closeAndDispose(); BambooTools.reportTestFinishedMessage(simulationTestingParameters.getShowWindows()); }
@Disabled //org.junit.runners.model.TestTimedOutException: test timed out after 300000 milliseconds @Test// timeout=300000 public void testSimulationConstructionSetNewViewportWindowUsingGUITestFixture() throws AWTException { Assume.assumeTrue(!isGradleBuild()); FallingBrickRobot robot = new FallingBrickRobot(); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); scs.setDT(0.0001, 100); scs.setFrameMaximized(); scs.startOnAThread(); scs.setSimulateDuration(2.0); ThreadTools.sleep(2000); SimulationGUITestFixture testFixture = new SimulationGUITestFixture(scs); testFixture.closeAllViewportWindows(); testFixture.selectNewViewportWindowMenu(); testFixture.focusNthViewportWindow(0); ThreadTools.sleepForever(); testFixture.closeAndDispose(); scs.closeAndDispose(); scs = null; testFixture = null; }