[Title] Enhance test case
authorBon-Yong Lee <bonyong.lee@samsung.com>
Tue, 23 Oct 2012 08:37:58 +0000 (17:37 +0900)
committerBon-Yong Lee <bonyong.lee@samsung.com>
Tue, 23 Oct 2012 08:37:58 +0000 (17:37 +0900)
[Desc.]
[Issue]

org.tizen.common/src/org/tizen/common/file/ClasspathFileHandler.java [new file with mode: 0755]
org.tizen.common/src/org/tizen/common/file/VirtualFileHandler.java
org.tizen.common/test/src/org/tizen/common/util/EFSUtilTest.java [changed mode: 0644->0755]
org.tizen.common/test/src/org/tizen/common/util/ImageUtilTest.java [changed mode: 0644->0755]
org.tizen.common/test/src/org/tizen/common/util/url/cp/HandlerTest.java [changed mode: 0644->0755]

diff --git a/org.tizen.common/src/org/tizen/common/file/ClasspathFileHandler.java b/org.tizen.common/src/org/tizen/common/file/ClasspathFileHandler.java
new file mode 100755 (executable)
index 0000000..5b6be8e
--- /dev/null
@@ -0,0 +1,101 @@
+package org.tizen.common.file;\r
+\r
+import java.io.IOException;\r
+import java.io.InputStream;\r
+import java.util.Collection;\r
+\r
+public class\r
+ClasspathFileHandler\r
+extends AbstractFileHandler\r
+{\r
+    protected String cwd;\r
+\r
+    @Override\r
+    public String getCurrentWorkingDirectory()\r
+    {\r
+        return cwd;\r
+    }\r
+\r
+    @Override\r
+    public void setCurrentWorkingDirectory(String cwd)\r
+    {\r
+        this.cwd = cwd;\r
+    }\r
+\r
+    @Override\r
+    public void makeDirectory(String path) throws IOException\r
+    {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void moveDirectory(String source, String target) throws IOException\r
+    {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void copyDirectory(String source, String target) throws IOException\r
+    {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void removeDirectory(String path) throws IOException\r
+    {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public Collection<String> list(String path) throws IOException\r
+    {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void write(String path, InputStream out) throws IOException\r
+    {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public InputStream read(String path) throws IOException\r
+    {\r
+        // TODO Auto-generated method stub\r
+        return null;\r
+    }\r
+\r
+    @Override\r
+    public void moveFile(String source, String target) throws IOException\r
+    {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void copyFile(String source, String target) throws IOException\r
+    {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void removeFile(String path) throws IOException\r
+    {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public Object get(String path, Attribute name) throws IOException\r
+    {\r
+        // TODO Auto-generated method stub\r
+        return null;\r
+    }\r
+\r
+    @Override\r
+    public void set(String path, Attribute name, Object value)\r
+    throws IOException\r
+    {\r
+        // TODO Auto-generated method stub\r
+        \r
+    }\r
+\r
+}\r
index 92ebb3f..7cf2c9b 100755 (executable)
@@ -613,6 +613,7 @@ extends AbstractFileHandler
        )
        throws IOException
        {
+           logger.trace( "Read {}", path );
                final File file = getFile( path );
                if ( file instanceof Directory )
                {
old mode 100644 (file)
new mode 100755 (executable)
index 27097d2..7ca9108
@@ -94,10 +94,13 @@ public class EFSUtilTest {
      */
     @After
     public void tearDown() {
-        if ( null == oldConfig ) {
-            System.getProperties().remove( PROP_PKG );
-        } else {
-            System.setProperty( PROP_PKG, oldConfig );
+        if ( null == oldConfig )
+        {
+            System.clearProperty( "java.protocol.handler.pkgs" );
+        }
+        else
+        {
+            System.setProperty( "java.protocol.handler.pkgs", oldConfig );
         }
     }
     
old mode 100644 (file)
new mode 100755 (executable)
index 5894536..ceb5eff
@@ -92,12 +92,14 @@ public class ImageUtilTest
         ImageUtil.pluginSurrogate = null;
         ImageUtil.platformSurrogate = null;
 
-       if ( null == oldConfig )
+        if ( null == oldConfig )
         {
-            System.getProperties().remove( PROP_PKG );
-            return ;
+            System.clearProperty( PROP_PKG );
+        }
+        else
+        {
+            System.setProperty( PROP_PKG, oldConfig );
         }
-        System.setProperty( PROP_PKG, oldConfig );
     }
 
     /**
old mode 100644 (file)
new mode 100755 (executable)
index 34d0a33..d92218f
@@ -74,12 +74,14 @@ HandlerTest
        @After
        public void tearDown()
        {
-               if ( null == oldConfig )
-               {
-                       System.getProperties().remove( PROP_PKG );
-                       return ;
-               }
-               System.setProperty( PROP_PKG, oldConfig );
+        if ( null == oldConfig )
+        {
+            System.clearProperty( "java.protocol.handler.pkgs" );
+        }
+        else
+        {
+            System.setProperty( "java.protocol.handler.pkgs", oldConfig );
+        }
        }
        
        /**