http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/applications/parfor/ParForUnivariateStatsTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/applications/parfor/ParForUnivariateStatsTest.java
 
b/src/test/java/org/apache/sysml/test/integration/applications/parfor/ParForUnivariateStatsTest.java
index 4303e50..82deb95 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/applications/parfor/ParForUnivariateStatsTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/applications/parfor/ParForUnivariateStatsTest.java
@@ -22,7 +22,6 @@ package org.apache.sysml.test.integration.applications.parfor;
 import java.util.HashMap;
 
 import org.junit.Test;
-
 import org.apache.sysml.hops.Hop;
 import org.apache.sysml.lops.LopProperties.ExecType;
 import org.apache.sysml.runtime.controlprogram.ParForProgramBlock.PExecMode;
@@ -100,6 +99,9 @@ public class ParForUnivariateStatsTest extends 
AutomatedTestBase
         */
        private void runParForUnivariateStatsTest( boolean parallel, PExecMode 
outer, PExecMode inner, ExecType instType )
        {
+               if(shouldSkipTest())
+                       return;
+               
                //inst exec type, influenced via rows
                int rows = -1;
                if( instType == ExecType.CP )

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/conversion/RDDConverterUtilsExtTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/conversion/RDDConverterUtilsExtTest.java
 
b/src/test/java/org/apache/sysml/test/integration/conversion/RDDConverterUtilsExtTest.java
index 89de76d..4ffdb68 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/conversion/RDDConverterUtilsExtTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/conversion/RDDConverterUtilsExtTest.java
@@ -19,8 +19,6 @@
 
 package org.apache.sysml.test.integration.conversion;
 
-import static org.junit.Assert.assertTrue;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -77,6 +75,9 @@ public class RDDConverterUtilsExtTest extends 
AutomatedTestBase {
 
        @Test
        public void testStringDataFrameToVectorDataFrame() {
+               if(shouldSkipTest())
+                       return;
+               
                List<String> list = new ArrayList<String>();
                list.add("((1.2, 4.3, 3.4))");
                list.add("(1.2, 3.4, 2.2)");
@@ -105,6 +106,8 @@ public class RDDConverterUtilsExtTest extends 
AutomatedTestBase {
 
        @Test
        public void testStringDataFrameToVectorDataFrameNull() {
+               if(shouldSkipTest())
+                       return;
                List<String> list = new ArrayList<String>();
                list.add("[1.2, 3.4]");
                list.add(null);
@@ -129,6 +132,8 @@ public class RDDConverterUtilsExtTest extends 
AutomatedTestBase {
 
        @Test(expected = SparkException.class)
        public void testStringDataFrameToVectorDataFrameNonNumbers() {
+               if(shouldSkipTest())
+                       return;
                List<String> list = new ArrayList<String>();
                list.add("[cheeseburger,fries]");
                JavaRDD<String> javaRddString = sc.parallelize(list);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/AggregateInfTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/AggregateInfTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/AggregateInfTest.java
index e89da18..bc2a211 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/AggregateInfTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/AggregateInfTest.java
@@ -22,7 +22,6 @@ package org.apache.sysml.test.integration.functions.aggregate;
 import java.util.HashMap;
 
 import org.junit.Test;
-
 import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM;
 import org.apache.sysml.lops.LopProperties.ExecType;
 import org.apache.sysml.runtime.matrix.data.MatrixValue.CellIndex;
@@ -111,9 +110,9 @@ public class AggregateInfTest extends AutomatedTestBase
         */
        private void runInfAggregateOperationTest( boolean pos, boolean sparse, 
ExecType instType)
        {
-               //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               rtplatform = (instType==ExecType.MR) ? RUNTIME_PLATFORM.HADOOP 
: RUNTIME_PLATFORM.HYBRID;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               if(shouldSkipTest())
+                       return;
        
                try
                {

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/AggregateNaNTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/AggregateNaNTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/AggregateNaNTest.java
index cdfa3cb..7a033ce 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/AggregateNaNTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/AggregateNaNTest.java
@@ -19,7 +19,6 @@
 
 package org.apache.sysml.test.integration.functions.aggregate;
 
-import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.Arrays;
@@ -109,6 +108,9 @@ public class AggregateNaNTest extends AutomatedTestBase
        }
        
        private void runNaNAggregateTest(int type, boolean sparse) {
+               if(shouldSkipTest())
+                       return;
+               
                //generate input
                double sparsity = sparse ? sparsity1 : sparsity2;
                double[][] A = getRandomMatrix(rows, cols, -0.05, 1, sparsity, 
7); 
@@ -123,10 +125,13 @@ public class AggregateNaNTest extends AutomatedTestBase
                        case 3: ret = mb.max();
                }
                
-               Assert.assertTrue(Double.isNaN(ret));
+               assertTrue(Double.isNaN(ret));
        }
        
        private void runNaNRowIndexMxxTest(String type, boolean sparse) {
+               if(shouldSkipTest())
+                       return;
+               
                //generate input
                double sparsity = sparse ? sparsity1 : sparsity2;
                double[][] A = getRandomMatrix(rows, cols, -0.05, 1, sparsity, 
7);
@@ -137,6 +142,6 @@ public class AggregateNaNTest extends AutomatedTestBase
                InstructionUtils.parseBasicAggregateUnaryOperator(type),
                new MatrixBlock(), -1, -1, new MatrixIndexes(1, 1), 
true).getValue(7, 0);
 
-               Assert.assertTrue(ret == 1);
+               assertTrue(ret == 1);
        }
 }

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColStdDevsTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColStdDevsTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColStdDevsTest.java
index 6208aa4..2c66d31 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColStdDevsTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColStdDevsTest.java
@@ -214,23 +214,10 @@ public class ColStdDevsTest extends AutomatedTestBase {
      */
     private void testColStdDevs(String testName, Sparsity sparsity, DataType 
dataType,
                                 ExecType platform) {
-        // Configure settings for this test case
-        RUNTIME_PLATFORM platformOld = rtplatform;
-        switch (platform) {
-            case MR:
-                rtplatform = RUNTIME_PLATFORM.HADOOP;
-                break;
-            case SPARK:
-                rtplatform = RUNTIME_PLATFORM.SPARK;
-                break;
-            default:
-                rtplatform = RUNTIME_PLATFORM.SINGLE_NODE;
-                break;
-        }
-
-        boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-        if (rtplatform == RUNTIME_PLATFORM.SPARK)
-            DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+       boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+       RUNTIME_PLATFORM platformOld = setRuntimePlatform(platform);
+       if(shouldSkipTest())
+                       return;
 
         try {
             // Create and load test configuration

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColSumTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColSumTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColSumTest.java
index 2ce5fb8..5d21767 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColSumTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColSumTest.java
@@ -60,6 +60,9 @@ public class ColSumTest extends AutomatedTestBase
 
     @Test
     public void testGeneral() {
+       if(shouldSkipTest())
+                       return;
+       
         int rows = 10;
         int cols = 10;
 
@@ -94,6 +97,9 @@ public class ColSumTest extends AutomatedTestBase
 
     @Test
     public void testScalar() {
+       if(shouldSkipTest())
+                       return;
+       
         int scalar = 12;
 
         TestConfiguration config = getTestConfiguration(TEST_SCALAR);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColSumsSqTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColSumsSqTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColSumsSqTest.java
index 0c539ce..85206c5 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColSumsSqTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColSumsSqTest.java
@@ -29,7 +29,6 @@ import org.apache.sysml.test.integration.AutomatedTestBase;
 import org.apache.sysml.test.integration.TestConfiguration;
 import org.apache.sysml.test.utils.TestUtils;
 import org.apache.sysml.utils.Statistics;
-import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.HashMap;
@@ -200,27 +199,16 @@ public class ColSumsSqTest extends AutomatedTestBase {
      */
     private void testColSumsSquared(String testName, boolean sparse, boolean 
vector,
                                     boolean rewrites, ExecType platform) {
+       
+       boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+       RUNTIME_PLATFORM platformOld = setRuntimePlatform(platform);
+       if(shouldSkipTest())
+                       return;
+       
         // Configure settings for this test case
         boolean rewritesOld = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
         OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = rewrites;
 
-        RUNTIME_PLATFORM platformOld = rtplatform;
-        switch (platform) {
-            case MR:
-                rtplatform = RUNTIME_PLATFORM.HADOOP;
-                break;
-            case SPARK:
-                rtplatform = RUNTIME_PLATFORM.SPARK;
-                break;
-            default:
-                rtplatform = RUNTIME_PLATFORM.SINGLE_NODE;
-                break;
-        }
-
-        boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-        if (rtplatform == RUNTIME_PLATFORM.SPARK)
-            DMLScript.USE_LOCAL_SPARK_CONFIG = true;
-
         try {
             // Create and load test configuration
             getAndLoadTestConfiguration(testName);
@@ -253,9 +241,9 @@ public class ColSumsSqTest extends AutomatedTestBase {
                 String opcode = prefix + op;
                 boolean rewriteApplied = 
Statistics.getCPHeavyHitterOpCodes().contains(opcode);
                 if (vector)
-                    Assert.assertFalse("Rewrite applied to vector case.", 
rewriteApplied);
+                    assertFalse("Rewrite applied to vector case.", 
rewriteApplied);
                 else
-                    Assert.assertTrue("Rewrite not applied to matrix case.", 
rewriteApplied);
+                    assertTrue("Rewrite not applied to matrix case.", 
rewriteApplied);
             }
         }
         finally {

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColVariancesTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColVariancesTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColVariancesTest.java
index 83495ce..736de21 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColVariancesTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ColVariancesTest.java
@@ -29,7 +29,6 @@ import org.apache.sysml.test.integration.AutomatedTestBase;
 import org.apache.sysml.test.integration.TestConfiguration;
 import org.apache.sysml.test.utils.TestUtils;
 import org.apache.sysml.utils.Statistics;
-import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.HashMap;
@@ -365,27 +364,16 @@ public class ColVariancesTest extends AutomatedTestBase {
      */
     private void testColVariances(String testName, Sparsity sparsity, DataType 
dataType,
                                   boolean rewrites, ExecType platform) {
+       
+       boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+       RUNTIME_PLATFORM platformOld = setRuntimePlatform(platform);
+       if(shouldSkipTest())
+                       return;
+       
         // Configure settings for this test case
         boolean rewritesOld = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
         OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = rewrites;
 
-        RUNTIME_PLATFORM platformOld = rtplatform;
-        switch (platform) {
-            case MR:
-                rtplatform = RUNTIME_PLATFORM.HADOOP;
-                break;
-            case SPARK:
-                rtplatform = RUNTIME_PLATFORM.SPARK;
-                break;
-            default:
-                rtplatform = RUNTIME_PLATFORM.SINGLE_NODE;
-                break;
-        }
-
-        boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-        if (rtplatform == RUNTIME_PLATFORM.SPARK)
-            DMLScript.USE_LOCAL_SPARK_CONFIG = true;
-
         try {
             // Create and load test configuration
             getAndLoadTestConfiguration(testName);
@@ -451,12 +439,12 @@ public class ColVariancesTest extends AutomatedTestBase {
                 if (dataType == DataType.ROWVECTOR) {
                     String opcode = prefix + colVarOp;
                     boolean rewriteApplied = 
!Statistics.getCPHeavyHitterOpCodes().contains(opcode);
-                    Assert.assertTrue("Rewrite not applied to row vector 
case.", rewriteApplied);
+                    assertTrue("Rewrite not applied to row vector case.", 
rewriteApplied);
 
                 } else if (dataType == DataType.COLUMNVECTOR) {
                     String opcode = prefix + varOp;
                     boolean rewriteApplied = 
Statistics.getCPHeavyHitterOpCodes().contains(opcode);
-                    Assert.assertTrue("Rewrite not applied to column vector 
case.", rewriteApplied);
+                    assertTrue("Rewrite not applied to column vector case.", 
rewriteApplied);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullAggregateTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullAggregateTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullAggregateTest.java
index bc67935..59e9a2f 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullAggregateTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullAggregateTest.java
@@ -22,7 +22,6 @@ package org.apache.sysml.test.integration.functions.aggregate;
 import java.util.HashMap;
 
 import org.junit.AfterClass;
-import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -537,16 +536,10 @@ public class FullAggregateTest extends AutomatedTestBase
         */
        private void runColAggregateOperationTest( OpType type, boolean sparse, 
boolean vector, ExecType instType)
        {
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( instType ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               if(shouldSkipTest())
+                       return;
 
                try
                {
@@ -589,7 +582,7 @@ public class FullAggregateTest extends AutomatedTestBase
        
                        runTest(true, false, null, -1); 
                        if( instType==ExecType.CP ) //in CP no MR jobs should 
be executed
-                               Assert.assertEquals("Unexpected number of 
executed MR jobs.", 0, Statistics.getNoOfExecutedMRJobs());
+                               assertEquals("Unexpected number of executed MR 
jobs.", 0, Statistics.getNoOfExecutedMRJobs());
                
                        runRScript(true); 
                
@@ -606,4 +599,4 @@ public class FullAggregateTest extends AutomatedTestBase
        }
        
                
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullColAggregateTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullColAggregateTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullColAggregateTest.java
index 296e6b4..d503f5f 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullColAggregateTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullColAggregateTest.java
@@ -594,16 +594,10 @@ public class FullColAggregateTest extends 
AutomatedTestBase
         */
        private void runColAggregateOperationTest( OpType type, boolean sparse, 
boolean vector, ExecType instType, boolean rewrites)
        {
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( instType ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               if(shouldSkipTest())
+                       return;
 
                boolean oldRewritesFlag = 
OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
                OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = rewrites;

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullGroupedAggregateMatrixTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullGroupedAggregateMatrixTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullGroupedAggregateMatrixTest.java
index f3e4201..639a953 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullGroupedAggregateMatrixTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullGroupedAggregateMatrixTest.java
@@ -341,17 +341,10 @@ public class FullGroupedAggregateMatrixTest extends 
AutomatedTestBase
        @SuppressWarnings("rawtypes")
        private void runGroupedAggregateOperationTest( String testname, OpType 
type, boolean sparse, ExecType instType, int numCols) 
        {
-               //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( instType ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               if(shouldSkipTest())
+                       return;
        
                try
                {

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullGroupedAggregateTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullGroupedAggregateTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullGroupedAggregateTest.java
index 8966ab2..8706b26 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullGroupedAggregateTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullGroupedAggregateTest.java
@@ -564,17 +564,10 @@ public class FullGroupedAggregateTest extends 
AutomatedTestBase
         */
        private void runGroupedAggregateOperationTest( OpType type, boolean 
sparse, boolean weights, boolean transpose, ExecType instType) 
        {
-               //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( instType ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               if(shouldSkipTest())
+                       return;
        
                try
                {
@@ -646,4 +639,4 @@ public class FullGroupedAggregateTest extends 
AutomatedTestBase
        }
        
                
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullRowAggregateTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullRowAggregateTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullRowAggregateTest.java
index c1fe03c..bbda49d 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullRowAggregateTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/FullRowAggregateTest.java
@@ -1122,16 +1122,11 @@ public class FullRowAggregateTest extends 
AutomatedTestBase
         */
        private void runRowAggregateOperationTest( OpType type, boolean sparse, 
boolean vector, ExecType instType, boolean specialData, boolean rewrites)
        {
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( instType ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               
+               if(shouldSkipTest())
+                       return;
 
                boolean oldRewritesFlag = 
OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
                OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = rewrites;

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/LengthTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/LengthTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/LengthTest.java
index 790936e..e691c31 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/LengthTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/LengthTest.java
@@ -60,6 +60,9 @@ public class LengthTest extends AutomatedTestBase
 
     @Test
     public void testGeneral() {
+       if(shouldSkipTest())
+                       return;
+       
         int rows = 10;
         int cols = 10;
 
@@ -85,6 +88,9 @@ public class LengthTest extends AutomatedTestBase
 
     @Test
     public void testScalar() {
+       if(shouldSkipTest())
+                       return;
+       
         int scalar = 12;
 
         TestConfiguration config = getTestConfiguration(TEST_SCALAR);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/MaxTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/MaxTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/MaxTest.java
index 32d1b90..b091879 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/MaxTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/MaxTest.java
@@ -60,6 +60,9 @@ public class MaxTest extends AutomatedTestBase
 
     @Test
     public void testGeneral() {
+       if(shouldSkipTest())
+                       return;
+       
         int rows = 10;
         int cols = 10;
 
@@ -95,6 +98,9 @@ public class MaxTest extends AutomatedTestBase
 
     @Test
     public void testScalar() {
+       if(shouldSkipTest())
+                       return;
+       
         int scalar = 12;
 
         TestConfiguration config = getTestConfiguration(TEST_SCALAR);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/MinTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/MinTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/MinTest.java
index 2933dab..7c6d8da 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/MinTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/MinTest.java
@@ -60,6 +60,9 @@ public class MinTest extends AutomatedTestBase
 
     @Test
     public void testGeneral() {
+       if(shouldSkipTest())
+                       return;
+       
         int rows = 10;
         int cols = 10;
 
@@ -95,6 +98,9 @@ public class MinTest extends AutomatedTestBase
 
     @Test
     public void testScalar() {
+       if(shouldSkipTest())
+                       return;
+       
         int scalar = 12;
 
         TestConfiguration config = getTestConfiguration(TEST_SCALAR);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/NColTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/NColTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/NColTest.java
index 6dbcf16..7c6122e 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/NColTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/NColTest.java
@@ -60,6 +60,9 @@ public class NColTest extends AutomatedTestBase
 
     @Test
     public void testGeneral() {
+       if(shouldSkipTest())
+                       return;
+       
         int rows = 10;
         int cols = 10;
 
@@ -85,6 +88,9 @@ public class NColTest extends AutomatedTestBase
 
     @Test
     public void testScalar() {
+       if(shouldSkipTest())
+                       return;
+       
         int scalar = 12;
 
         TestConfiguration config = getTestConfiguration(TEST_SCALAR);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/NRowTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/NRowTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/NRowTest.java
index a9dfbb4..0fb1cff 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/NRowTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/NRowTest.java
@@ -60,6 +60,9 @@ public class NRowTest extends AutomatedTestBase
 
     @Test
     public void testGeneral() {
+       if(shouldSkipTest())
+                       return;
+       
         int rows = 10;
         int cols = 10;
 
@@ -85,6 +88,9 @@ public class NRowTest extends AutomatedTestBase
 
     @Test
     public void testScalar() {
+       if(shouldSkipTest())
+                       return;
+       
         int scalar = 12;
 
         TestConfiguration config = getTestConfiguration(TEST_SCALAR);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ProdTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ProdTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ProdTest.java
index 43f68d4..28a5ba9 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ProdTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/ProdTest.java
@@ -60,6 +60,9 @@ public class ProdTest extends AutomatedTestBase
 
     @Test
     public void testGeneral() {
+       if(shouldSkipTest())
+                       return;
+       
         int rows = 10;
         int cols = 10;
 
@@ -95,6 +98,9 @@ public class ProdTest extends AutomatedTestBase
 
     @Test
     public void testScalar() {
+       if(shouldSkipTest())
+                       return;
+       
         int scalar = 12;
 
         TestConfiguration config = getTestConfiguration(TEST_SCALAR);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/PushdownSumBinaryTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/PushdownSumBinaryTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/PushdownSumBinaryTest.java
index 1b87231..a93529e 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/PushdownSumBinaryTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/PushdownSumBinaryTest.java
@@ -22,7 +22,6 @@ package org.apache.sysml.test.integration.functions.aggregate;
 import java.util.HashMap;
 
 import org.junit.AfterClass;
-import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.apache.sysml.api.DMLScript;
@@ -107,17 +106,11 @@ public class PushdownSumBinaryTest extends 
AutomatedTestBase
         */
        private void runPushdownSumOnBinaryTest( String testname, boolean 
equiDims, ExecType instType) 
        {
-               //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( instType ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               if(shouldSkipTest())
+                       return;
+               
                        
                try
                {
@@ -152,7 +145,7 @@ public class PushdownSumBinaryTest extends AutomatedTestBase
                        
                        String lopcode = TEST_NAME.equals(TEST_NAME1) ? "+" : 
"-";
                        String opcode = equiDims ? lopcode : 
Instruction.SP_INST_PREFIX+"map"+lopcode;
-                       Assert.assertTrue("Non-applied rewrite", 
Statistics.getCPHeavyHitterOpCodes().contains(opcode));        
+                       assertTrue("Non-applied rewrite", 
Statistics.getCPHeavyHitterOpCodes().contains(opcode));       
                }
                finally
                {

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowColProdsAggregateTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowColProdsAggregateTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowColProdsAggregateTest.java
index 97ae324..45b83f0 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowColProdsAggregateTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowColProdsAggregateTest.java
@@ -112,16 +112,12 @@ public class RowColProdsAggregateTest extends 
AutomatedTestBase
 
        private void runProdsAggregateTest(String TEST_NAME, boolean sparse, 
boolean rewrites, ExecType instType)
        {
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( instType ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
+               
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               if(shouldSkipTest())
+                       return;
+               
 
                boolean oldRewritesFlag = 
OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
                OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = rewrites;

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowStdDevsTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowStdDevsTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowStdDevsTest.java
index e2e50fe..19b00f2 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowStdDevsTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowStdDevsTest.java
@@ -214,23 +214,10 @@ public class RowStdDevsTest extends AutomatedTestBase {
      */
     private void testRowStdDevs(String testName, Sparsity sparsity, DataType 
dataType,
                                 ExecType platform) {
-        // Configure settings for this test case
-        RUNTIME_PLATFORM platformOld = rtplatform;
-        switch (platform) {
-            case MR:
-                rtplatform = RUNTIME_PLATFORM.HADOOP;
-                break;
-            case SPARK:
-                rtplatform = RUNTIME_PLATFORM.SPARK;
-                break;
-            default:
-                rtplatform = RUNTIME_PLATFORM.SINGLE_NODE;
-                break;
-        }
-
-        boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-        if (rtplatform == RUNTIME_PLATFORM.SPARK)
-            DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+       boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+       RUNTIME_PLATFORM platformOld = setRuntimePlatform(platform);        
+        if(shouldSkipTest())
+                       return;
 
         try {
             // Create and load test configuration

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowSumTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowSumTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowSumTest.java
index e8a7faf..7a69e4e 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowSumTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowSumTest.java
@@ -60,6 +60,9 @@ public class RowSumTest extends AutomatedTestBase
 
     @Test
     public void testGeneral() {
+       if(shouldSkipTest())
+                       return;
+       
         int rows = 10;
         int cols = 10;
 
@@ -90,6 +93,9 @@ public class RowSumTest extends AutomatedTestBase
 
     @Test
     public void testScalar() {
+       if(shouldSkipTest())
+                       return;
+       
         int scalar = 12;
 
         TestConfiguration config = getTestConfiguration(TEST_SCALAR);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowSumsSqTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowSumsSqTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowSumsSqTest.java
index bffd19b..3ca3000 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowSumsSqTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowSumsSqTest.java
@@ -29,7 +29,6 @@ import org.apache.sysml.test.integration.AutomatedTestBase;
 import org.apache.sysml.test.integration.TestConfiguration;
 import org.apache.sysml.test.utils.TestUtils;
 import org.apache.sysml.utils.Statistics;
-import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.HashMap;
@@ -200,27 +199,16 @@ public class RowSumsSqTest extends AutomatedTestBase {
      */
     private void testRowSumsSquared(String testName, boolean sparse, boolean 
vector,
                                     boolean rewrites, ExecType platform) {
+        boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+        RUNTIME_PLATFORM platformOld = setRuntimePlatform(platform);
+        if(shouldSkipTest())
+                       return;
+
+        
         // Configure settings for this test case
         boolean rewritesOld = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
         OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = rewrites;
 
-        RUNTIME_PLATFORM platformOld = rtplatform;
-        switch (platform) {
-            case MR:
-                rtplatform = RUNTIME_PLATFORM.HADOOP;
-                break;
-            case SPARK:
-                rtplatform = RUNTIME_PLATFORM.SPARK;
-                break;
-            default:
-                rtplatform = RUNTIME_PLATFORM.SINGLE_NODE;
-                break;
-        }
-
-        boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-        if (rtplatform == RUNTIME_PLATFORM.SPARK)
-            DMLScript.USE_LOCAL_SPARK_CONFIG = true;
-
         try {
             // Create and load test configuration
             getAndLoadTestConfiguration(testName);
@@ -253,9 +241,9 @@ public class RowSumsSqTest extends AutomatedTestBase {
                 String opcode = prefix + op;
                 boolean rewriteApplied = 
Statistics.getCPHeavyHitterOpCodes().contains(opcode);
                 if (vector)
-                    Assert.assertFalse("Rewrite applied to vector case.", 
rewriteApplied);
+                    assertFalse("Rewrite applied to vector case.", 
rewriteApplied);
                 else
-                    Assert.assertTrue("Rewrite not applied to matrix case.", 
rewriteApplied);
+                    assertTrue("Rewrite not applied to matrix case.", 
rewriteApplied);
             }
         }
         finally {

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowVariancesTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowVariancesTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowVariancesTest.java
index 3557859..a8dce37 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowVariancesTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/RowVariancesTest.java
@@ -29,7 +29,6 @@ import org.apache.sysml.test.integration.AutomatedTestBase;
 import org.apache.sysml.test.integration.TestConfiguration;
 import org.apache.sysml.test.utils.TestUtils;
 import org.apache.sysml.utils.Statistics;
-import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.HashMap;
@@ -365,27 +364,15 @@ public class RowVariancesTest extends AutomatedTestBase {
      */
     private void testRowVariances(String testName, Sparsity sparsity, DataType 
dataType,
                                   boolean rewrites, ExecType platform) {
+       boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+       RUNTIME_PLATFORM platformOld = setRuntimePlatform(platform);
+       if(shouldSkipTest())
+                       return;
+       
         // Configure settings for this test case
         boolean rewritesOld = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
         OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = rewrites;
 
-        RUNTIME_PLATFORM platformOld = rtplatform;
-        switch (platform) {
-            case MR:
-                rtplatform = RUNTIME_PLATFORM.HADOOP;
-                break;
-            case SPARK:
-                rtplatform = RUNTIME_PLATFORM.SPARK;
-                break;
-            default:
-                rtplatform = RUNTIME_PLATFORM.SINGLE_NODE;
-                break;
-        }
-
-        boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-        if (rtplatform == RUNTIME_PLATFORM.SPARK)
-            DMLScript.USE_LOCAL_SPARK_CONFIG = true;
-
         try {
             // Create and load test configuration
             getAndLoadTestConfiguration(testName);
@@ -451,12 +438,12 @@ public class RowVariancesTest extends AutomatedTestBase {
                 if (dataType == DataType.ROWVECTOR) {
                     String opcode = prefix + varOp;
                     boolean rewriteApplied = 
Statistics.getCPHeavyHitterOpCodes().contains(opcode);
-                    Assert.assertTrue("Rewrite not applied to row vector 
case.", rewriteApplied);
+                    assertTrue("Rewrite not applied to row vector case.", 
rewriteApplied);
 
                 } else if (dataType == DataType.COLUMNVECTOR) {
                     String opcode = prefix + rowVarOp;
                     boolean rewriteApplied = 
!Statistics.getCPHeavyHitterOpCodes().contains(opcode);
-                    Assert.assertTrue("Rewrite not applied to column vector 
case.", rewriteApplied);
+                    assertTrue("Rewrite not applied to column vector case.", 
rewriteApplied);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/StdDevTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/StdDevTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/StdDevTest.java
index fc98a50..c0ec0ae 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/StdDevTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/StdDevTest.java
@@ -213,23 +213,10 @@ public class StdDevTest extends AutomatedTestBase {
      */
     private void testStdDev(String testName, Sparsity sparsity, DataType 
dataType,
                             ExecType platform) {
-        // Configure settings for this test case
-        RUNTIME_PLATFORM platformOld = rtplatform;
-        switch (platform) {
-            case MR:
-                rtplatform = RUNTIME_PLATFORM.HADOOP;
-                break;
-            case SPARK:
-                rtplatform = RUNTIME_PLATFORM.SPARK;
-                break;
-            default:
-                rtplatform = RUNTIME_PLATFORM.SINGLE_NODE;
-                break;
-        }
-
-        boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-        if (rtplatform == RUNTIME_PLATFORM.SPARK)
-            DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+       boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+       RUNTIME_PLATFORM platformOld = setRuntimePlatform(platform);
+       if(shouldSkipTest())
+                       return;
 
         try {
             // Create and load test configuration

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/SumSqTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/SumSqTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/SumSqTest.java
index 5b80baa..31bbcad 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/SumSqTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/SumSqTest.java
@@ -29,7 +29,6 @@ import org.apache.sysml.test.integration.AutomatedTestBase;
 import org.apache.sysml.test.integration.TestConfiguration;
 import org.apache.sysml.test.utils.TestUtils;
 import org.apache.sysml.utils.Statistics;
-import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.HashMap;
@@ -200,27 +199,15 @@ public class SumSqTest extends AutomatedTestBase {
      */
     private void testSumSquared(String testName, boolean sparse, boolean 
vector,
                                 boolean rewrites, ExecType platform) {
+       boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+       RUNTIME_PLATFORM platformOld = setRuntimePlatform(platform);
+       if(shouldSkipTest())
+                       return;
+       
         // Configure settings for this test case
         boolean rewritesOld = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
         OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = rewrites;
 
-        RUNTIME_PLATFORM platformOld = rtplatform;
-        switch (platform) {
-            case MR:
-                rtplatform = RUNTIME_PLATFORM.HADOOP;
-                break;
-            case SPARK:
-                rtplatform = RUNTIME_PLATFORM.SPARK;
-                break;
-            default:
-                rtplatform = RUNTIME_PLATFORM.SINGLE_NODE;
-                break;
-        }
-
-        boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-        if (rtplatform == RUNTIME_PLATFORM.SPARK)
-            DMLScript.USE_LOCAL_SPARK_CONFIG = true;
-
         try {
             // Create and load test configuration
             getAndLoadTestConfiguration(testName);
@@ -253,9 +240,9 @@ public class SumSqTest extends AutomatedTestBase {
                 String opcode = prefix + op;
                 boolean rewriteApplied = 
Statistics.getCPHeavyHitterOpCodes().contains(opcode);
                 if (vector)
-                    Assert.assertFalse("Rewrite applied to vector case.", 
rewriteApplied);
+                    assertFalse("Rewrite applied to vector case.", 
rewriteApplied);
                 else
-                    Assert.assertTrue("Rewrite not applied to matrix case.", 
rewriteApplied);
+                    assertTrue("Rewrite not applied to matrix case.", 
rewriteApplied);
             }
         }
         finally {

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/SumTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/SumTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/SumTest.java
index 7dee001..f3c68a1 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/SumTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/SumTest.java
@@ -60,6 +60,9 @@ public class SumTest extends AutomatedTestBase
 
     @Test
     public void testGeneral() {
+       if(shouldSkipTest())
+                       return;
+       
         int rows = 10;
         int cols = 10;
 
@@ -95,6 +98,9 @@ public class SumTest extends AutomatedTestBase
 
     @Test
     public void testScalar() {
+       if(shouldSkipTest())
+                       return;
+       
         int scalar = 3;
 
         TestConfiguration config = getTestConfiguration(TEST_SCALAR);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/TraceTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/TraceTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/TraceTest.java
index 9c67c07..440e54d 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/TraceTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/TraceTest.java
@@ -58,6 +58,9 @@ public class TraceTest extends AutomatedTestBase
 
     @Test
     public void testGeneral() {
+       if(shouldSkipTest())
+                       return;
+       
         int rows = 10;
         int cols = 10;
 
@@ -85,6 +88,9 @@ public class TraceTest extends AutomatedTestBase
 
     @Test
     public void testScalar() {
+       if(shouldSkipTest())
+                       return;
+       
         int scalar = 12;
 
         TestConfiguration config = getTestConfiguration(TEST_SCALAR);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/aggregate/VarianceTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/VarianceTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/VarianceTest.java
index c44bf0d..ac5dd02 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/aggregate/VarianceTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/aggregate/VarianceTest.java
@@ -214,23 +214,11 @@ public class VarianceTest extends AutomatedTestBase {
      */
     private void testVariance(String testName, Sparsity sparsity, DataType 
dataType,
                               ExecType platform) {
-        // Configure settings for this test case
-        RUNTIME_PLATFORM platformOld = rtplatform;
-        switch (platform) {
-            case MR:
-                rtplatform = RUNTIME_PLATFORM.HADOOP;
-                break;
-            case SPARK:
-                rtplatform = RUNTIME_PLATFORM.SPARK;
-                break;
-            default:
-                rtplatform = RUNTIME_PLATFORM.SINGLE_NODE;
-                break;
-        }
+       boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+       RUNTIME_PLATFORM platformOld = setRuntimePlatform(platform);
+       if(shouldSkipTest())
+                       return;
 
-        boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-        if (rtplatform == RUNTIME_PLATFORM.SPARK)
-            DMLScript.USE_LOCAL_SPARK_CONFIG = true;
 
         try {
             // Create and load test configuration

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/append/AppendChainTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/append/AppendChainTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/append/AppendChainTest.java
index e6981fc..2edf316 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/append/AppendChainTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/append/AppendChainTest.java
@@ -21,7 +21,6 @@ package org.apache.sysml.test.integration.functions.append;
 
 import java.util.HashMap;
 
-import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.sysml.api.DMLScript;
@@ -135,8 +134,11 @@ public class AppendChainTest extends AutomatedTestBase
        {
                TestConfiguration config = 
getAndLoadTestConfiguration(TEST_NAME);
            
-               RUNTIME_PLATFORM prevPlfm=rtplatform;
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+               RUNTIME_PLATFORM prevPlfm= setRuntimePlatform(platform);
+               if(shouldSkipTest())
+                       return;
+               
                
                try
                {
@@ -177,7 +179,7 @@ public class AppendChainTest extends AutomatedTestBase
                        int expectedExecutedMRJobs = 
(rtplatform==RUNTIME_PLATFORM.HADOOP)? 2+((cols3>1)?1:0) : 0; 
                        runTest(true, exceptionExpected, null, 
expectedCompiledMRJobs);
                        runRScript(true);
-                       Assert.assertEquals("Wrong number of executed MR jobs.",
+                       assertEquals("Wrong number of executed MR jobs.",
                                                     expectedExecutedMRJobs, 
Statistics.getNoOfExecutedMRJobs());
                        
                        //compare result data

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/append/AppendMatrixTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/append/AppendMatrixTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/append/AppendMatrixTest.java
index 07a358f..31ac396 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/append/AppendMatrixTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/append/AppendMatrixTest.java
@@ -22,9 +22,7 @@ package org.apache.sysml.test.integration.functions.append;
 import java.util.HashMap;
 import java.util.Random;
 
-import org.junit.Assert;
 import org.junit.Test;
-import org.apache.sysml.api.DMLScript;
 import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM;
 import org.apache.sysml.hops.BinaryOp;
 import org.apache.sysml.hops.OptimizerUtils;
@@ -216,19 +214,16 @@ public class AppendMatrixTest extends AutomatedTestBase
        {
                TestConfiguration config = 
getAndLoadTestConfiguration(TEST_NAME);
            
-               RUNTIME_PLATFORM prevPlfm=rtplatform;
+               RUNTIME_PLATFORM prevPlfm= setRuntimePlatform(platform);
+               if(shouldSkipTest())
+                       return;
                
                double sparsity = (sparse) ? sparsity2 : sparsity1; 
-               boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               
                try
                {
                        if(forcedAppendMethod != null) {
                                BinaryOp.FORCED_APPEND_METHOD = 
forcedAppendMethod;
                        }
-                   rtplatform = platform;
-                   if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                               DMLScript.USE_LOCAL_SPARK_CONFIG = true;
        
                config.addVariable("rows", rows);
                config.addVariable("cols", cols1);
@@ -258,7 +253,7 @@ public class AppendMatrixTest extends AutomatedTestBase
                        int expectedExecutedMRJobs = 
(rtplatform==RUNTIME_PLATFORM.HADOOP)? 2 : 0;
                        runTest(true, exceptionExpected, null, 
expectedCompiledMRJobs);
                        runRScript(true);
-                       Assert.assertEquals("Wrong number of executed MR jobs.",
+                       assertEquals("Wrong number of executed MR jobs.",
                                                    expectedExecutedMRJobs, 
Statistics.getNoOfExecutedMRJobs());
        
                        for(String file: config.getOutputFiles())
@@ -272,7 +267,6 @@ public class AppendMatrixTest extends AutomatedTestBase
                {
                        //reset execution platform
                        rtplatform = prevPlfm;
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = sparkConfigOld;
                        BinaryOp.FORCED_APPEND_METHOD = null;
                }
        }

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/append/AppendVectorTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/append/AppendVectorTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/append/AppendVectorTest.java
index f5bf5ee..9419685 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/append/AppendVectorTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/append/AppendVectorTest.java
@@ -22,7 +22,6 @@ package org.apache.sysml.test.integration.functions.append;
 import java.util.HashMap;
 import java.util.Random;
 
-import org.junit.Assert;
 import org.junit.Test;
 import org.apache.sysml.api.DMLScript;
 import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM;
@@ -88,12 +87,10 @@ public class AppendVectorTest extends AutomatedTestBase
        {
                TestConfiguration config = 
getAndLoadTestConfiguration(TEST_NAME);
            
-               RUNTIME_PLATFORM prevPlfm=rtplatform;
-               
-           rtplatform = platform;
            boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-           if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+           RUNTIME_PLATFORM prevPlfm = setRuntimePlatform(platform);
+               if(shouldSkipTest())
+                       return;
 
            try {
                config.addVariable("rows", rows);
@@ -122,7 +119,7 @@ public class AppendVectorTest extends AutomatedTestBase
                int expectedCompiledMRJobs = 
(rtplatform==RUNTIME_PLATFORM.HADOOP)? 2 : 1;
                        int expectedExecutedMRJobs = 
(rtplatform==RUNTIME_PLATFORM.HADOOP)? 2 : 0;
                        runTest(true, exceptionExpected, null, 
expectedCompiledMRJobs);
-                       Assert.assertEquals("Wrong number of executed MR jobs.",
+                       assertEquals("Wrong number of executed MR jobs.",
                                                     expectedExecutedMRJobs, 
Statistics.getNoOfExecutedMRJobs());
                
                        runRScript(true);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/append/RBindCBindMatrixTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/append/RBindCBindMatrixTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/append/RBindCBindMatrixTest.java
index 27559e6..521080f 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/append/RBindCBindMatrixTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/append/RBindCBindMatrixTest.java
@@ -21,7 +21,6 @@ package org.apache.sysml.test.integration.functions.append;
 
 import java.util.HashMap;
 
-import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.sysml.api.DMLScript;
@@ -133,16 +132,10 @@ public class RBindCBindMatrixTest extends 
AutomatedTestBase
         */
        public void runRBindTest(String testname, boolean sparse, ExecType et)
        {               
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( et ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(et);
+               if(shouldSkipTest())
+                       return;
 
                String TEST_NAME = testname;
                TestConfiguration config = getTestConfiguration(TEST_NAME);
@@ -179,7 +172,7 @@ public class RBindCBindMatrixTest extends AutomatedTestBase
                        //check applied rewrite t(cbind(t(A),t(B)) --> 
rbind(A,B)
                        if( testname.equals(TEST_NAME2) ){
                                String opcode = 
((et==ExecType.SPARK)?Instruction.SP_INST_PREFIX:"")+"r'";
-                               Assert.assertTrue("Rewrite not applied", 
!Statistics.getCPHeavyHitterOpCodes().contains(opcode) );
+                               assertTrue("Rewrite not applied", 
!Statistics.getCPHeavyHitterOpCodes().contains(opcode) );
                        }
                }
                finally

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/append/StringAppendTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/append/StringAppendTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/append/StringAppendTest.java
index 23ff0c3..d4efc3d 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/append/StringAppendTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/append/StringAppendTest.java
@@ -106,18 +106,11 @@ public class StringAppendTest extends AutomatedTestBase
         * @param cols3
         */
        public void runStringAppendTest(String TEST_NAME, int iters, boolean 
exceptionExpected, ExecType et)
-       {
-               RUNTIME_PLATFORM oldPlatform = rtplatform;              
-
-           if(et == ExecType.SPARK) {
-               rtplatform = RUNTIME_PLATFORM.SPARK;
-           }
-           else {
-                       rtplatform = (et==ExecType.MR) ? 
RUNTIME_PLATFORM.HADOOP : RUNTIME_PLATFORM.HYBRID;
-           }
+       {               
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM oldPlatform = setRuntimePlatform(et);
+               if(shouldSkipTest())
+                       return;
                
                try
                {

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/BinUaggChainTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/BinUaggChainTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/BinUaggChainTest.java
index 9f63c9c..97e323e 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/BinUaggChainTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/BinUaggChainTest.java
@@ -119,17 +119,10 @@ public class BinUaggChainTest extends AutomatedTestBase
         */
        private void runBinUaggTest( String testname, boolean singleBlock, 
boolean sparse, ExecType instType)
        {
-               //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( instType ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               if(shouldSkipTest())
+                       return;
 
                try
                {
@@ -171,4 +164,4 @@ public class BinUaggChainTest extends AutomatedTestBase
                }
        }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/CentralMomentTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/CentralMomentTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/CentralMomentTest.java
index 4760ef6..96a8023 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/CentralMomentTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/CentralMomentTest.java
@@ -171,17 +171,10 @@ public class CentralMomentTest extends AutomatedTestBase
         */
        private void runCentralMomentTest( int order, boolean sparse, ExecType 
et)
        {
-               //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( et ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(et);
+               if(shouldSkipTest())
+                       return;
                
                try
                {
@@ -216,4 +209,4 @@ public class CentralMomentTest extends AutomatedTestBase
                }
        }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/CovarianceTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/CovarianceTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/CovarianceTest.java
index 8816b18..64ff13a 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/CovarianceTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/CovarianceTest.java
@@ -101,16 +101,10 @@ public class CovarianceTest extends AutomatedTestBase
        private void runCovarianceTest( boolean sparse, ExecType et)
        {
                //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( et ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(et);
+               if(shouldSkipTest())
+                       return;
                
                try
                {
@@ -145,4 +139,4 @@ public class CovarianceTest extends AutomatedTestBase
                }
        }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/DiagMatrixMultiplicationTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/DiagMatrixMultiplicationTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/DiagMatrixMultiplicationTest.java
index b7afe2e..799ea8b 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/DiagMatrixMultiplicationTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/DiagMatrixMultiplicationTest.java
@@ -288,17 +288,10 @@ public class DiagMatrixMultiplicationTest extends 
AutomatedTestBase
         */
        private void runDiagMatrixMultiplicationTest( boolean sparseM1, boolean 
sparseM2, boolean rightTranspose, boolean rightVector, ExecType instType, 
boolean simplify)
        {
-               //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( instType ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               if(shouldSkipTest())
+                       return;
                
                String TEST_NAME = rightTranspose ? TEST_NAME2 : TEST_NAME1;
                boolean oldFlagSimplify = 
OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseAdditionMultiplicationTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseAdditionMultiplicationTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseAdditionMultiplicationTest.java
index f78e598..619e99c 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseAdditionMultiplicationTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseAdditionMultiplicationTest.java
@@ -47,6 +47,9 @@ public class ElementwiseAdditionMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testTerm1() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 5;
                int cols = 4;
                TestConfiguration config = 
availableTestConfigurations.get("Term1");
@@ -79,6 +82,9 @@ public class ElementwiseAdditionMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testTerm2() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 5;
                int cols = 4;
                TestConfiguration config = 
availableTestConfigurations.get("Term2");
@@ -109,6 +115,9 @@ public class ElementwiseAdditionMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testTerm3() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 5;
                int cols = 4;
                TestConfiguration config = 
availableTestConfigurations.get("Term3");

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseAdditionTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseAdditionTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseAdditionTest.java
index db58191..8436f53 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseAdditionTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseAdditionTest.java
@@ -64,6 +64,9 @@ public class ElementwiseAdditionTest extends AutomatedTestBase
        
        @Test
        public void testDense() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 10;
                int cols = 10;
                
@@ -93,6 +96,9 @@ public class ElementwiseAdditionTest extends AutomatedTestBase
        
        @Test
        public void testSparse() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 50;
                int cols = 50;
                
@@ -122,6 +128,9 @@ public class ElementwiseAdditionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessRows() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 10;
                int rows2 = 10;
@@ -140,6 +149,9 @@ public class ElementwiseAdditionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreRows() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 10;
                int rows2 = 10;
@@ -158,6 +170,9 @@ public class ElementwiseAdditionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 10;
                int cols1 = 8;
                int rows2 = 10;
@@ -176,6 +191,9 @@ public class ElementwiseAdditionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 10;
                int cols1 = 12;
                int rows2 = 10;
@@ -194,6 +212,10 @@ public class ElementwiseAdditionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessRowsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
+               
                int rows1 = 8;
                int cols1 = 8;
                int rows2 = 10;
@@ -212,6 +234,10 @@ public class ElementwiseAdditionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreRowsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
+               
                int rows1 = 12;
                int cols1 = 12;
                int rows2 = 10;
@@ -230,6 +256,9 @@ public class ElementwiseAdditionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessRowsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 12;
                int rows2 = 10;
@@ -248,6 +277,10 @@ public class ElementwiseAdditionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreRowsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
+               
                int rows1 = 12;
                int cols1 = 8;
                int rows2 = 10;

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseBitwLogicalTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseBitwLogicalTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseBitwLogicalTest.java
index a1255ca..cc268e9 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseBitwLogicalTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseBitwLogicalTest.java
@@ -208,19 +208,11 @@ public class ElementwiseBitwLogicalTest extends 
AutomatedTestBase{
        }
 
        private void runBitwLogic(String testname, boolean sparse, ExecType et) 
{
-               //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-
-               switch( et ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID_SPARK; 
break;
-               }
-
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK || rtplatform == 
RUNTIME_PLATFORM.HYBRID_SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
-
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(et);
+               if(shouldSkipTest())
+                       return;
+                               
                try {
                        String TEST_NAME = testname;
                        getAndLoadTestConfiguration(TEST_NAME);

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseDivisionTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseDivisionTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseDivisionTest.java
index 07091fe..2c9ba6d 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseDivisionTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseDivisionTest.java
@@ -67,6 +67,9 @@ public class ElementwiseDivisionTest extends AutomatedTestBase
 
        @Test
        public void testDense() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 10;
                int cols = 10;
                
@@ -96,6 +99,9 @@ public class ElementwiseDivisionTest extends AutomatedTestBase
 
        @Test
        public void testSparse() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 50;
                int cols = 50;
                
@@ -125,6 +131,8 @@ public class ElementwiseDivisionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessRows() {
+               if(shouldSkipTest())
+                       return;
                int rows1 = 8;
                int cols1 = 10;
                int rows2 = 10;
@@ -143,6 +151,9 @@ public class ElementwiseDivisionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreRows() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 10;
                int rows2 = 10;
@@ -161,6 +172,9 @@ public class ElementwiseDivisionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 10;
                int cols1 = 8;
                int rows2 = 10;
@@ -179,6 +193,9 @@ public class ElementwiseDivisionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 10;
                int cols1 = 12;
                int rows2 = 10;
@@ -197,6 +214,9 @@ public class ElementwiseDivisionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessRowsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 8;
                int rows2 = 10;
@@ -215,6 +235,9 @@ public class ElementwiseDivisionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreRowsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 12;
                int rows2 = 10;
@@ -233,6 +256,9 @@ public class ElementwiseDivisionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessRowsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 12;
                int rows2 = 10;
@@ -251,6 +277,9 @@ public class ElementwiseDivisionTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreRowsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 8;
                int rows2 = 10;
@@ -269,6 +298,9 @@ public class ElementwiseDivisionTest extends 
AutomatedTestBase
        
        @Test
        public void testDivisionByZero() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 10;
                int cols = 10;
                

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseLogicalTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseLogicalTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseLogicalTest.java
index 8b23300..9c2c0de 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseLogicalTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseLogicalTest.java
@@ -182,17 +182,10 @@ public class ElementwiseLogicalTest extends 
AutomatedTestBase{
        }
        
        private void runLogical(String testname, boolean sparse, ExecType et) {
-               //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( et ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID_SPARK; 
break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK || rtplatform == 
RUNTIME_PLATFORM.HYBRID_SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(et);
+               if(shouldSkipTest())
+                       return;
        
                try {
                        String TEST_NAME = testname;

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseModulusTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseModulusTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseModulusTest.java
index 4213b43..4493c49 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseModulusTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseModulusTest.java
@@ -65,6 +65,9 @@ public class ElementwiseModulusTest extends AutomatedTestBase
 
        @Test
        public void testDense() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 10;
                int cols = 10;
                
@@ -95,6 +98,9 @@ public class ElementwiseModulusTest extends AutomatedTestBase
 
        @Test
        public void testSparse() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 50;
                int cols = 50;
                
@@ -124,6 +130,9 @@ public class ElementwiseModulusTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessRows() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 10;
                int rows2 = 10;
@@ -142,6 +151,9 @@ public class ElementwiseModulusTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreRows() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 10;
                int rows2 = 10;
@@ -178,6 +190,9 @@ public class ElementwiseModulusTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 10;
                int cols1 = 12;
                int rows2 = 10;
@@ -196,6 +211,9 @@ public class ElementwiseModulusTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessRowsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 8;
                int rows2 = 10;
@@ -214,6 +232,9 @@ public class ElementwiseModulusTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreRowsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 12;
                int rows2 = 10;
@@ -232,6 +253,9 @@ public class ElementwiseModulusTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsLessRowsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 12;
                int rows2 = 10;
@@ -250,6 +274,9 @@ public class ElementwiseModulusTest extends 
AutomatedTestBase
        
        @Test
        public void testWrongDimensionsMoreRowsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 8;
                int rows2 = 10;
@@ -268,6 +295,9 @@ public class ElementwiseModulusTest extends 
AutomatedTestBase
        
        @Test
        public void testDivisionByZero() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 10;
                int cols = 10;
                

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseMultiplicationTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseMultiplicationTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseMultiplicationTest.java
index d99f137..148ea06 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseMultiplicationTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseMultiplicationTest.java
@@ -66,6 +66,9 @@ public class ElementwiseMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testDense() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 10;
                int cols = 10;
 
@@ -95,6 +98,9 @@ public class ElementwiseMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testSparse() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 50;
                int cols = 50;
 
@@ -124,6 +130,9 @@ public class ElementwiseMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsLessRows() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 10;
                int rows2 = 10;
@@ -160,6 +169,9 @@ public class ElementwiseMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 10;
                int cols1 = 8;
                int rows2 = 10;
@@ -178,6 +190,9 @@ public class ElementwiseMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 10;
                int cols1 = 12;
                int rows2 = 10;
@@ -196,6 +211,9 @@ public class ElementwiseMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsLessRowsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 8;
                int rows2 = 10;
@@ -214,6 +232,9 @@ public class ElementwiseMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsMoreRowsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 12;
                int rows2 = 10;
@@ -232,6 +253,9 @@ public class ElementwiseMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsLessRowsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 12;
                int rows2 = 10;
@@ -250,6 +274,9 @@ public class ElementwiseMultiplicationTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsMoreRowsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 8;
                int rows2 = 10;

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseSubtractionTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseSubtractionTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseSubtractionTest.java
index 5220aec..2d60b72 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseSubtractionTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/ElementwiseSubtractionTest.java
@@ -65,6 +65,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testDense() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 10;
                int cols = 10;
 
@@ -94,6 +97,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testSparse() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 10;
                int cols = 10;
 
@@ -123,6 +129,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testOperatorPrecedence() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows = 10;
                int cols = 10;
 
@@ -153,6 +162,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsLessRows() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 10;
                int rows2 = 10;
@@ -171,6 +183,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsMoreRows() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 10;
                int rows2 = 10;
@@ -189,6 +204,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 10;
                int cols1 = 8;
                int rows2 = 10;
@@ -207,6 +225,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 10;
                int cols1 = 12;
                int rows2 = 10;
@@ -225,6 +246,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsLessRowsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 8;
                int rows2 = 10;
@@ -243,6 +267,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsMoreRowsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 12;
                int rows2 = 10;
@@ -261,6 +288,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsLessRowsMoreCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 8;
                int cols1 = 12;
                int rows2 = 10;
@@ -279,6 +309,9 @@ public class ElementwiseSubtractionTest extends 
AutomatedTestBase
 
        @Test
        public void testWrongDimensionsMoreRowsLessCols() {
+               if(shouldSkipTest())
+                       return;
+               
                int rows1 = 12;
                int cols1 = 8;
                int rows2 = 10;

http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/MapMultChainTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/MapMultChainTest.java
 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/MapMultChainTest.java
index d23ac04..bcb88a7 100644
--- 
a/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/MapMultChainTest.java
+++ 
b/src/test/java/org/apache/sysml/test/integration/functions/binary/matrix/MapMultChainTest.java
@@ -22,7 +22,6 @@ package 
org.apache.sysml.test.integration.functions.binary.matrix;
 import java.util.HashMap;
 
 import org.junit.AfterClass;
-import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -308,18 +307,11 @@ public class MapMultChainTest extends AutomatedTestBase
         */
        private void runMapMultChainTest( String testname, boolean sparse, 
boolean sumProductRewrites, ExecType instType)
        {
-               //rtplatform for MR
-               RUNTIME_PLATFORM platformOld = rtplatform;
-               switch( instType ){
-                       case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
-                       case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
-                       default: rtplatform = RUNTIME_PLATFORM.HYBRID; break;
-               }
-       
                boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-               if( rtplatform == RUNTIME_PLATFORM.SPARK )
-                       DMLScript.USE_LOCAL_SPARK_CONFIG = true;
-               
+               RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType);
+               if(shouldSkipTest())
+                       return;
+                       
                //rewrite
                boolean rewritesOld = OptimizerUtils.ALLOW_SUM_PRODUCT_REWRITES;
                OptimizerUtils.ALLOW_SUM_PRODUCT_REWRITES = sumProductRewrites;
@@ -372,7 +364,7 @@ public class MapMultChainTest extends AutomatedTestBase
                        //check compiled mmchain instructions (cp/spark)
                        if( instType != ExecType.MR ){
                                String opcode = 
(instType==ExecType.CP)?MapMultChain.OPCODE_CP:"sp_"+MapMultChain.OPCODE;
-                               Assert.assertEquals(sumProductRewrites, 
Statistics.getCPHeavyHitterOpCodes().contains(opcode));
+                               assertEquals(sumProductRewrites, 
Statistics.getCPHeavyHitterOpCodes().contains(opcode));
                        }
                }
                finally
@@ -383,4 +375,4 @@ public class MapMultChainTest extends AutomatedTestBase
                }
        }
 
-}
\ No newline at end of file
+}

Reply via email to