1 28 29 package com.idaremedia.antx.feedback.tests; 30 31 import junit.framework.TestSuite; 32 33 import com.idaremedia.antx.ut.HTCUtils; 34 35 45 46 public final class CheckpointTaskTest extends EmitTestSkeleton 47 { 48 49 public static final String TEST_CATEGORY="CLASS"; 50 51 52 55 public CheckpointTaskTest(String methodName) 56 { 57 super("CheckpointTask::",methodName); 58 } 59 60 61 64 public static TestSuite suite() 65 { 66 return new TestSuite(CheckpointTaskTest.class); 67 } 68 69 70 73 public static TestSuite baseline() 74 { 75 return suite(); 76 } 77 78 79 82 public static void main(String [] argv) 83 { 84 HTCUtils.quickCheck(suite()); 85 } 86 87 88 92 protected String getDefaultConfigureXMLFileName() 93 { 94 return "cp.xml"; 95 } 96 97 private void verifyNoAntLogs(int i, int j) 98 { 99 String log = getLog(); 100 verifyOccurances(log,"Helloworld",i); 101 verifyOccurances(log,"Howdy!",i); 102 verifyOccurances(log,"Hello poo-poo",i); 103 104 String fullLog = getFullLog(); 105 verifyOccurances(fullLog,"Helloworld",j); 106 verifyOccurances(fullLog,"Howdy!",j); 107 verifyOccurances(fullLog,"Hello poo-poo",j); 108 } 109 110 private void verifyNoLog4jLog(int i) 111 { 112 String log4jLog= testAppender().getLog(); 113 verifyOccurances(log4jLog,"Helloworld",i); 114 verifyOccurances(log4jLog,"Howdy!",i); 115 verifyOccurances(log4jLog,"Hello poo-poo",i); 116 } 117 118 122 public void testCheckpoints_AntX03() 123 { 124 runEchoedTarget("testCheckpoints_AntX03"); 125 verifyNoAntLogs(0,0); 126 verifyNoLog4jLog(1); 127 } 128 129 public void testCheckpointsIfUnless_AntX03() 130 { 131 runEchoedTarget("testCheckpointsIfUnless_AntX03"); 132 verifyNoAntLogs(0,0); 133 verifyNoLog4jLog(0); 134 } 135 136 public void testCheckpointsToFile_AntX03() 137 { 138 runEchoedTarget("testCheckpointsToFile_AntX03"); 139 verifyNoLog4jLog(0); 140 } 141 142 public void testCheckpointNoSourceLabel_AntX05() 143 { 144 final String targetName = "testCheckpointNoSourceLabel_AntX05"; 145 runEchoedTarget(targetName); 146 String log = getLog(); 147 verifyOccurances(log,targetName,0); 148 String log4jLog= testAppender().getLog(); 149 verifyOccurances(log4jLog,targetName,0); 150 } 151 } 152 153 154 | Popular Tags |