public void testGetStackSize() { assertEquals(0, myTestSuiteStack.getStackSize()); myTestSuiteStack.pushSuite(mySuite); assertEquals(1, myTestSuiteStack.getStackSize()); myTestSuiteStack.popSuite(mySuite.getName()); assertEquals(0, myTestSuiteStack.getStackSize()); }
public void testPushSuite() { myTestSuiteStack.pushSuite(mySuite); assertEquals(1, myTestSuiteStack.getStackSize()); assertEquals(mySuite, myTestSuiteStack.getCurrentSuite()); myTestSuiteStack.pushSuite(mySuite); assertEquals(2, myTestSuiteStack.getStackSize()); assertEquals(mySuite, myTestSuiteStack.getCurrentSuite()); final SMTestProxy newSuite = createSuiteProxy(); myTestSuiteStack.pushSuite(newSuite); assertEquals(3, myTestSuiteStack.getStackSize()); assertEquals(newSuite, myTestSuiteStack.getCurrentSuite()); }
public void testPopInconsistentSuite_NormalMode() throws Throwable { final String suiteName = mySuite.getName(); myTestSuiteStack.pushSuite(createSuiteProxy("0")); myTestSuiteStack.pushSuite(mySuite); myTestSuiteStack.pushSuite(createSuiteProxy("2")); myTestSuiteStack.pushSuite(createSuiteProxy("3")); assertEquals(4, myTestSuiteStack.getStackSize()); assertEquals("3", myTestSuiteStack.getCurrentSuite().getName()); assertNotNull(myTestSuiteStack.popSuite(suiteName)); assertEquals(1, myTestSuiteStack.getStackSize()); }
public void testPopSuite() throws Throwable { final String suiteName = mySuite.getName(); myTestSuiteStack.pushSuite(mySuite); assertEquals(mySuite, myTestSuiteStack.popSuite(suiteName)); assertEquals(0, myTestSuiteStack.getStackSize()); }
public void testClear() { myTestSuiteStack.pushSuite(createSuiteProxy("1")); myTestSuiteStack.pushSuite(createSuiteProxy("2")); myTestSuiteStack.pushSuite(createSuiteProxy("3")); myTestSuiteStack.clear(); assertEquals(0, myTestSuiteStack.getStackSize()); }
public void testPopInconsistentSuite_DebugMode() throws Throwable { enableDebugMode(); final String suiteName = mySuite.getName(); myTestSuiteStack.pushSuite(createSuiteProxy("0")); myTestSuiteStack.pushSuite(mySuite); myTestSuiteStack.pushSuite(createSuiteProxy("2")); myTestSuiteStack.pushSuite(createSuiteProxy("3")); assertEquals(4, myTestSuiteStack.getStackSize()); assertEquals("3", myTestSuiteStack.getCurrentSuite().getName()); assertException( new AssertionErrorCase() { @Override public void tryClosure() { myTestSuiteStack.popSuite(suiteName); } }); assertEquals(4, myTestSuiteStack.getStackSize()); }