1 28 29 package com.idaremedia.antx.flowcontrol.tests; 30 31 import junit.framework.TestSuite; 32 33 import com.idaremedia.antx.ut.HTCUtils; 34 35 45 46 public final class InlineForEachTaskTest extends StepCallerTestSkeleton 47 { 48 49 public static final String TEST_CATEGORY="CLASS"; 50 51 52 55 public InlineForEachTaskTest(String methodName) 56 { 57 super("InlineForEachTask::",methodName); 58 } 59 60 61 64 public static TestSuite suiteOfOne(String testName) 65 { 66 TestSuite s = new TestSuite(); 67 s.setName("Suite-of-One:"+testName); 68 s.addTest(new InlineForEachTaskTest(testName)); 69 return s; 70 } 71 72 73 76 public static TestSuite suite() 77 { 78 return new TestSuite(InlineForEachTaskTest.class); 79 } 81 82 83 86 public static TestSuite baseline() 87 { 88 return suite(); 89 } 90 91 92 95 public static void main(String [] argv) 96 { 97 HTCUtils.quickCheck(suite()); 98 } 99 100 101 105 protected String getDefaultConfigureXMLFileName() 106 { 107 return "iforeach.xml"; 108 } 109 110 111 final int verifyTargetsRanInLoop(String [] cursors, int ilastmatch) 112 { 113 String log= getLog(); 114 String match; 115 int imatch; 116 for (int i=0;i<cursors.length;i++) { 117 match = "(at:"+cursors[i]+")"; 118 imatch = log.indexOf(match,ilastmatch); 119 assertTrue("Expecting Log to contain \""+match+"\" from ["+ilastmatch+ 120 "] but Log was \"" + log + "\"", 121 imatch>=0); 122 ilastmatch = imatch+match.length(); 123 } 124 return ilastmatch; 125 } 126 127 131 public void testPassEmptyTaskset() 132 { 133 runTargetNoOutput("testPassEmptyTaskset"); 134 } 135 136 public void testFailBrokenLoopDefinitions() 137 { 138 runTarget("testBrokenLoops"); 139 } 140 141 public void testInLoopControl() 142 { 143 runTarget("testInLoopControl"); 144 int from=0; 145 from= verifyTargetsRanInLoop(new String []{"0"},from); 146 from= verifyTargetsRanInLoop(new String []{"0","1","2"},from); 147 from= verifyTargetsRanInLoop(new String []{"0","2","4"},from); 148 from= verifyTargetsRanInLoop(new String []{"-1","0"},from); 149 } 150 151 public void testNestedLoops() 152 { 153 runTarget("testNestedLoops"); 154 } 155 156 public void testNestedLoopsInSteps() 157 { 158 runTarget("testNestedLoopsInSteps"); 159 } 160 161 public void testBodyAsLocalMacroDef_AntX05() 162 { 163 runTarget("testBodyAsLocalMacroDef_AntX05"); 164 } 165 166 public void testNestedLoopsAsLocalMacroDef_AntX05() 167 { 168 runTarget("testNestedLoopsAsLocalMacroDef_AntX05"); 169 } 170 171 public void testMixAndMatchLoopTypes_AntX05() 172 { 173 runTarget("testMixAndMatchLoopTypes_AntX05"); 174 } 175 176 public void testHardLimits_AntX05() 177 { 178 runTarget("testHardLimits_AntX05"); 179 } 180 181 public void testLocalForEachFromMacrodef_AntX05() 182 { 183 runTarget("testLocalForEachFromMacrodef_AntX05"); 184 } 185 } 186 187 188 | Popular Tags |