SDB: blocking native install test when native plugin is not installed 82/15982/2
authorho.namkoong <ho.namkoong@samsung.com>
Tue, 4 Feb 2014 02:17:10 +0000 (11:17 +0900)
committerho.namkoong <ho.namkoong@samsung.com>
Tue, 4 Feb 2014 02:19:21 +0000 (11:19 +0900)
Some SDK does not support native app.
In this case, test case for install and uninstall native app fails.
For solving this, we check whether native plugin is installed or not in SDK

Change-Id: I04e6cd931b49fe3f4dbd0676bda2805eb019642e
Signed-off-by: ho.namkoong <ho.namkoong@samsung.com>
org.tizen.common/test/src/org/tizen/common/sdb/InstallTest.java
org.tizen.common/test/src/org/tizen/common/sdb/SdbTestUtil.java

index 34ed9a7..d368072 100644 (file)
@@ -135,7 +135,9 @@ public class InstallTest {
         final String appId = "ZFPK8xqL5F";
         final String copiedTpkName = "copied.tpk";
         
-        test_installUninstall(tpkName, copiedTpkName, appId);
+        if(SdbTestUtil.isNativePluginInstalled()) {
+            test_installUninstall(tpkName, copiedTpkName, appId);
+        }
     }
     
     /**
index a35a6a7..06607b7 100644 (file)
@@ -53,16 +53,17 @@ class SdbTestUtil {
     static final String LOOPBACK_IP = "127.0.0.1";
     static final int MAX_TRIAL = 10;
     static final char CTRL_C = '\u0003';
+    static String SDK_PATH;
     static String SDB_PATH;
     
     static {
-        SDB_PATH = System.getProperty("TIZEN_SDK");
+        SDK_PATH = System.getProperty("TIZEN_SDK");
         
-        if(StringUtil.isEmpty(SDB_PATH)) {
+        if(StringUtil.isEmpty(SDK_PATH)) {
             SDB_PATH = "sdb";
         }
         else {
-            SDB_PATH = FileUtil.appendPath(SDB_PATH, "tools/sdb");
+            SDB_PATH = FileUtil.appendPath(SDK_PATH, "tools/sdb");
         }
     }
     
@@ -107,6 +108,16 @@ class SdbTestUtil {
         return resultPorts;
     }
     
+    static boolean isNativePluginInstalled() throws Exception {
+        if(StringUtil.isEmpty(SDK_PATH)) {
+            return false;
+        }
+        
+        String toolChainPath = FileUtil.appendPath(SDK_PATH, "tools/smart-build-interface");
+        
+        return new File(toolChainPath).exists();
+    }
+    
     /**
      * Get serial numbers of connected targets
      *