You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by to...@apache.org on 2007/06/18 19:01:02 UTC
svn commit: r548413 - in
/harmony/enhanced/classlib/branches/java6/modules/luni: META-INF/ make/
src/test/api/unix/org/ src/test/api/unix/org/apache/
src/test/api/unix/org/apache/harmony/
src/test/api/unix/org/apache/harmony/luni/ src/test/api/unix/org...
Author: tonywu
Date: Mon Jun 18 10:01:00 2007
New Revision: 548413
URL: http://svn.apache.org/viewvc?view=rev&rev=548413
Log:
put platform specific tests to the right place and move out corresponding item from exclude list
Added:
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java
Modified:
harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF
harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl
harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl.interm
harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.ibm
harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86_64.drl
harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.drl
harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.ibm
harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.drl
harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.ibm
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF?view=diff&rev=548413&r1=548412&r2=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF Mon Jun 18 10:01:00 2007
@@ -13,6 +13,7 @@
Eclipse-JREBundle: true
Eclipse-ExtensibleAPI: true
Import-Package: com.ibm.icu.lang,
+ java.lang,
java.lang.annotation,
java.math,
java.nio,
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl?view=diff&rev=548413&r1=548412&r2=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl Mon Jun 18 10:01:00 2007
@@ -1,5 +1,4 @@
org/apache/harmony/luni/tests/java/lang/ThreadTest.java
org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
tests/api/java/net/SocketTest.java
-org/apache/harmony/luni/tests/java/io/windows/WinFileTest.java
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl.interm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl.interm?view=diff&rev=548413&r1=548412&r2=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl.interm (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl.interm Mon Jun 18 10:01:00 2007
@@ -1,4 +1,3 @@
#2315
org/apache/harmony/luni/tests/java/net/InetAddressTest.java
org/apache/harmony/tests/java/net/InetAddressTest.java
-org/apache/harmony/luni/tests/java/io/windows/WinFileTest.java
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.ibm?view=diff&rev=548413&r1=548412&r2=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.ibm (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.ibm Mon Jun 18 10:01:00 2007
@@ -2,4 +2,3 @@
org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
org/apache/harmony/luni/tests/java/lang/SecurityManager2Test.java
org/apache/harmony/luni/tests/java/lang/PackageTest.java
-org/apache/harmony/luni/tests/java/io/windows/WinFileTest.java
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86_64.drl?view=diff&rev=548413&r1=548412&r2=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86_64.drl (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86_64.drl Mon Jun 18 10:01:00 2007
@@ -3,4 +3,3 @@
org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
tests/api/java/net/SocketTest.java
tests/api/java/net/MulticastSocketTest.java
-org/apache/harmony/luni/tests/java/io/windows/WinFileTest.java
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.drl?view=diff&rev=548413&r1=548412&r2=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.drl (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.drl Mon Jun 18 10:01:00 2007
@@ -1 +0,0 @@
-org/apache/harmony/luni/tests/java/io/unix/UnixFileTest.java
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.ibm?view=diff&rev=548413&r1=548412&r2=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.ibm (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.ibm Mon Jun 18 10:01:00 2007
@@ -1,4 +1,3 @@
tests/api/java/util/PropertiesTest.java
org/apache/harmony/luni/tests/java/lang/SecurityManager2Test.java
org/apache/harmony/luni/tests/java/lang/PackageTest.java
-org/apache/harmony/luni/tests/java/io/unix/UnixFileTest.java
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.drl?view=diff&rev=548413&r1=548412&r2=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.drl (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.drl Mon Jun 18 10:01:00 2007
@@ -1,3 +1,2 @@
tests/api/java/net/MulticastSocketTest.java
tests/api/java/util/ArrayListTest.java
-org/apache/harmony/luni/tests/java/io/unix/UnixFileTest.java
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.ibm?view=diff&rev=548413&r1=548412&r2=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.ibm (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.ibm Mon Jun 18 10:01:00 2007
@@ -1 +0,0 @@
-org/apache/harmony/luni/tests/java/io/unix/UnixFileTest.java
Added: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java?view=auto&rev=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java Mon Jun 18 10:01:00 2007
@@ -0,0 +1,142 @@
+package org.apache.harmony.luni.tests.java.io;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+/**
+ * Please note that this case can only be passed on Linux due to some file
+ * system dependent reason.
+ *
+ */
+public class UnixFileTest extends TestCase {
+ private boolean root = false;
+
+ private File testFile;
+
+ private File testDir;
+
+ /**
+ * @tests java.io.File#canExecute()
+ *
+ * @since 1.6
+ */
+ public void test_canExecute() {
+ assertFalse(testFile.canExecute());
+ assertTrue(testFile.setExecutable(true, false));
+ assertTrue(testFile.canExecute());
+ assertTrue(testFile.setExecutable(true, true));
+ assertTrue(testFile.canExecute());
+
+ assertTrue(testFile.setExecutable(false, false));
+ assertFalse(testFile.canExecute());
+ assertTrue(testFile.setExecutable(false, true));
+ assertFalse(testFile.canExecute());
+
+ assertTrue(testFile.setExecutable(true, false));
+ assertTrue(testFile.canExecute());
+
+ // tests directory
+ assertTrue(testDir.canExecute());
+ assertTrue(testDir.setExecutable(false, true));
+ if (root) {
+ assertTrue(testDir.canExecute());
+ } else {
+ assertFalse(testDir.canExecute());
+ }
+ assertTrue(testDir.setExecutable(true, false));
+ assertTrue(testDir.canExecute());
+ }
+
+ /**
+ * @tests java.io.File#setExecutable(boolean, boolean)
+ *
+ * @since 1.6
+ */
+ public void test_setExecutableZZ() {
+ // setExecutable(true, true/false)
+ assertFalse(testFile.canExecute());
+ assertTrue(testFile.setExecutable(true, false));
+ assertTrue(testFile.canExecute());
+ assertTrue(testFile.setExecutable(true, true));
+ assertTrue(testFile.canExecute());
+
+ // setExecutable(false, true/false)
+ assertTrue(testFile.setExecutable(false, true));
+ if (root) {
+ assertTrue(testFile.canExecute());
+ } else {
+ assertFalse(testFile.canExecute());
+ }
+ assertTrue(testFile.setExecutable(false, false));
+ assertFalse(testFile.canExecute());
+
+ // tests directory
+ assertTrue(testDir.canExecute());
+ assertTrue(testDir.setExecutable(false, true));
+ if (root) {
+ assertTrue(testDir.canExecute());
+ } else {
+ assertFalse(testDir.canExecute());
+ }
+ assertTrue(testDir.setExecutable(false, false));
+ if (root) {
+ assertTrue(testDir.canExecute());
+ } else {
+ assertFalse(testDir.canExecute());
+ }
+
+ assertTrue(testDir.setExecutable(true, true));
+ assertTrue(testDir.canExecute());
+ assertTrue(testDir.setExecutable(true, false));
+ assertTrue(testDir.canExecute());
+ }
+
+ /**
+ * @tests java.io.File#setExecutable(boolean)
+ *
+ * @since 1.6
+ */
+ public void test_setExecutableZ() {
+ // So far this method only deals with the situation that the user is the
+ // owner of the file
+ assertTrue(testFile.setExecutable(true));
+ assertTrue(testFile.canExecute());
+ assertTrue(testFile.setExecutable(false));
+ assertFalse(testFile.canExecute());
+ assertTrue(testFile.setExecutable(true));
+
+ // tests directory
+ assertTrue(testDir.canExecute());
+ assertTrue(testDir.setExecutable(false));
+ if (root) {
+ assertTrue(testDir.canExecute());
+ } else {
+ assertFalse(testDir.canExecute());
+ }
+ assertTrue(testDir.setExecutable(true));
+ assertTrue(testDir.canExecute());
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ testFile = File.createTempFile("testfile", null);
+ testDir = new File(System.getProperty("java.io.tmpdir") + "/temp");
+ if (!testDir.exists()) {
+ testDir.mkdir();
+ }
+ root = System.getProperty("user.name").equals("root");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ testFile.delete();
+ testDir.delete();
+ testFile = null;
+ testDir = null;
+ root = false;
+ super.tearDown();
+ }
+
+}
Added: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java?view=auto&rev=548413
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java Mon Jun 18 10:01:00 2007
@@ -0,0 +1,94 @@
+package org.apache.harmony.luni.tests.java.io;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+/**
+ * Please note that this case can only be passed on Windows due to some file
+ * system dependent reason.
+ *
+ */
+
+public class WinFileTest extends TestCase {
+ private File testFile;
+
+ private File testDir;
+
+ /**
+ * @tests java.io.File#canExecute()
+ *
+ * @since 1.6
+ */
+ public void test_canExecute() {
+ // files and directories are always executable on Windows.
+ assertTrue(testFile.canExecute());
+ assertFalse(testFile.setExecutable(false, false));
+ assertTrue(testFile.canExecute());
+ assertTrue(testFile.setExecutable(true));
+ assertTrue(testFile.canExecute());
+
+ assertFalse(testDir.setExecutable(false, false));
+ assertTrue(testDir.canExecute());
+ }
+
+ /**
+ * @tests java.io.File#setExecutable(boolean, boolean)
+ *
+ * @since 1.6
+ */
+ public void test_setExecutableZZ() {
+ // setExecutable(false, true/false) fails on Windows.
+ assertTrue(testFile.canExecute());
+ assertFalse(testFile.setExecutable(false, false));
+ assertTrue(testFile.canExecute());
+ assertFalse(testFile.setExecutable(false, true));
+ // setExecutable(true, true/false)
+ assertTrue(testFile.setExecutable(true, false));
+ assertTrue(testFile.canExecute());
+ assertTrue(testFile.setExecutable(true, true));
+
+ // tests directory
+ assertTrue(testDir.canExecute());
+ assertFalse(testDir.setExecutable(false, true));
+ assertTrue(testDir.canExecute());
+ assertFalse(testDir.setExecutable(false, false));
+
+ assertTrue(testDir.setExecutable(true, true));
+ assertTrue(testDir.setExecutable(true, false));
+ assertTrue(testDir.canExecute());
+ }
+
+ /**
+ * @tests java.io.File#setExecutable(boolean)
+ *
+ * @since 1.6
+ */
+ public void test_setExecutableZ() {
+ // So far this method only deals with the situation that the user is the
+ // owner of the file
+ assertTrue(testFile.setExecutable(true));
+ assertFalse(testFile.setExecutable(false));
+ // tests directory
+ assertTrue(testDir.setExecutable(true));
+ assertFalse(testDir.setExecutable(false));
+ assertTrue(testDir.canExecute());
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ testFile = File.createTempFile("testfile", null);
+ testDir = new File(System.getProperty("java.io.tmpdir"));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ testFile.deleteOnExit();
+ testDir.deleteOnExit();
+ testFile = null;
+ testDir = null;
+ super.tearDown();
+ }
+
+}