2828import org .apache .sysds .test .TestConfiguration ;
2929import org .apache .sysds .test .TestUtils ;
3030
31- import java .io .ByteArrayOutputStream ;
32- import java .io .PrintStream ;
33-
3431public class RewriteMatrixChainDPTest extends AutomatedTestBase {
3532
3633 private static final String TEST_DIR = "functions/rewrite/mmchain/" ;
@@ -52,76 +49,76 @@ public void setUp() {
5249 }
5350
5451 @ Test
55- public void testMatrixChainDP_Test1 () { runTestMatrixChainDP (TEST_CASES [0 ]); }
52+ public void testMatrixChainDPTest1 () { runTestMatrixChainDP (TEST_CASES [0 ]); }
5653
5754 @ Test
58- public void testMatrixChainDP_Test2 () { runTestMatrixChainDP (TEST_CASES [1 ]); }
55+ public void testMatrixChainDPTest2 () { runTestMatrixChainDP (TEST_CASES [1 ]); }
5956
6057 @ Test
61- public void testMatrixChainDP_Test3 () { runTestMatrixChainDP (TEST_CASES [2 ]); }
58+ public void testMatrixChainDPTest3 () { runTestMatrixChainDP (TEST_CASES [2 ]); }
6259
6360 @ Test
64- public void testMatrixChainDP_Test4 () { runTestMatrixChainDP (TEST_CASES [3 ]); }
61+ public void testMatrixChainDPTest4 () { runTestMatrixChainDP (TEST_CASES [3 ]); }
6562
6663 @ Test
67- public void testMatrixChainDP_Test5 () { runTestMatrixChainDP (TEST_CASES [4 ]); }
64+ public void testMatrixChainDPTest5 () { runTestMatrixChainDP (TEST_CASES [4 ]); }
6865
6966 @ Test
70- public void testMatrixChainDP_Test6 () { runTestMatrixChainDP (TEST_CASES [5 ]); }
67+ public void testMatrixChainDPTest6 () { runTestMatrixChainDP (TEST_CASES [5 ]); }
7168
7269 @ Test
73- public void testMatrixChainDP_Test7 () { runTestMatrixChainDP (TEST_CASES [6 ]); }
70+ public void testMatrixChainDPTest7 () { runTestMatrixChainDP (TEST_CASES [6 ]); }
7471
7572 @ Test
76- public void testMatrixChainDP_Test8 () { runTestMatrixChainDP (TEST_CASES [7 ]); }
73+ public void testMatrixChainDPTest8 () { runTestMatrixChainDP (TEST_CASES [7 ]); }
7774
7875 @ Test
79- public void testMatrixChainDP_Test9 () { runTestMatrixChainDP (TEST_CASES [8 ]); }
76+ public void testMatrixChainDPTest9 () { runTestMatrixChainDP (TEST_CASES [8 ]); }
8077
8178 @ Test
82- public void testMatrixChainDP_Test10 () { runTestMatrixChainDP (TEST_CASES [9 ]); }
79+ public void testMatrixChainDPTest10 () { runTestMatrixChainDP (TEST_CASES [9 ]); }
8380
8481 @ Test
85- public void testMatrixChainDP_Test11 () { runTestMatrixChainDP (TEST_CASES [10 ]); }
82+ public void testMatrixChainDPTest11 () { runTestMatrixChainDP (TEST_CASES [10 ]); }
8683
8784 @ Test
88- public void testMatrixChainDP_Test12 () { runTestMatrixChainDP (TEST_CASES [11 ]); }
85+ public void testMatrixChainDPTest12 () { runTestMatrixChainDP (TEST_CASES [11 ]); }
8986
9087 @ Test
91- public void testMatrixChainDP_Test13 () { runTestMatrixChainDP (TEST_CASES [12 ]); }
88+ public void testMatrixChainDPTest13 () { runTestMatrixChainDP (TEST_CASES [12 ]); }
9289
9390 @ Test
94- public void testMatrixChainDP_Test14 () { runTestMatrixChainDP (TEST_CASES [13 ]); }
91+ public void testMatrixChainDPTest14 () { runTestMatrixChainDP (TEST_CASES [13 ]); }
9592
9693 @ Test
97- public void testMatrixChainDP_Test15 () { runTestMatrixChainDP (TEST_CASES [14 ]); }
94+ public void testMatrixChainDPTest15 () { runTestMatrixChainDP (TEST_CASES [14 ]); }
9895
9996 @ Test
100- public void testMatrixChainDP_Test16 () { runTestMatrixChainDP (TEST_CASES [15 ]); }
97+ public void testMatrixChainDPTest16 () { runTestMatrixChainDP (TEST_CASES [15 ]); }
10198
10299 @ Test
103- public void testMatrixChainDP_Test17 () { runTestMatrixChainDP (TEST_CASES [16 ]); }
100+ public void testMatrixChainDPTest17 () { runTestMatrixChainDP (TEST_CASES [16 ]); }
104101
105102 @ Test
106- public void testMatrixChainDP_Test18 () { runTestMatrixChainDP (TEST_CASES [17 ]); }
103+ public void testMatrixChainDPTest18 () { runTestMatrixChainDP (TEST_CASES [17 ]); }
107104
108105 @ Test
109- public void testMatrixChainDP_Test19 () { runTestMatrixChainDP (TEST_CASES [18 ]); }
106+ public void testMatrixChainDPTest19 () { runTestMatrixChainDP (TEST_CASES [18 ]); }
110107
111108 @ Test
112- public void testMatrixChainDP_Test20 () { runTestMatrixChainDP (TEST_CASES [19 ]); }
109+ public void testMatrixChainDPTest20 () { runTestMatrixChainDP (TEST_CASES [19 ]); }
113110
114111 @ Test
115- public void testMatrixChainDP_Test21 () { runTestMatrixChainDP (TEST_CASES [20 ]); }
112+ public void testMatrixChainDPTest21 () { runTestMatrixChainDP (TEST_CASES [20 ]); }
116113
117114 @ Test
118- public void testMatrixChainDP_Test22 () { runTestMatrixChainDP (TEST_CASES [21 ]); }
115+ public void testMatrixChainDPTest22 () { runTestMatrixChainDP (TEST_CASES [21 ]); }
119116
120117 @ Test
121- public void testMatrixChainDP_Test23 () { runTestMatrixChainDP (TEST_CASES [22 ]); }
118+ public void testMatrixChainDPTest23 () { runTestMatrixChainDP (TEST_CASES [22 ]); }
122119
123120 @ Test
124- public void testMatrixChainDP_Test24 () {runTestMatrixChainDP (TEST_CASES [23 ]);}
121+ public void testMatrixChainDPTest24 () {runTestMatrixChainDP (TEST_CASES [23 ]);}
125122
126123
127124 private void runTestMatrixChainDP (String testName ) {
@@ -144,23 +141,11 @@ private void runTestMatrixChainDP(String testName) {
144141
145142 programArgs = new String []{ "-explain" , "hops" , "-stats" , "-args" , output ("R" ) };
146143
147- // print HOP DAG
148- PrintStream originalOut = System .out ;
149- ByteArrayOutputStream bos = new ByteArrayOutputStream ();
150- System .setOut (new PrintStream (bos ));
151-
152- try {
153- // Execute the DML script
154- runTest (true , false , null , -1 );
155- } finally {
156- System .setOut (originalOut );
157- }
158-
159- String output = bos .toString ();
160-
161- System .out .println ("Output for " + testName + ":\n " + output );
144+ // Execute the DML script
145+ setOutputBuffering (true );
146+ String output = runTest (true , false , null , -1 ).toString ();
162147
163- /* the following uses the intermediate matrices dimensions to check, wether
148+ /* the following uses the intermediate matrices dimensions to check, whether
164149 * the rewrite rule has found the optimal plan, which is commented in each script
165150 */
166151 switch (testName ) {
0 commit comments