Author: andygumbrecht
Date: Tue Dec 11 10:16:18 2012
New Revision: 1420070

URL: http://svn.apache.org/viewvc?rev=1420070&view=rev
Log:
Skip tests on Win platforms

Modified:
    
openejb/branches/openejb-4.5.1/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java

Modified: 
openejb/branches/openejb-4.5.1/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java
URL: 
http://svn.apache.org/viewvc/openejb/branches/openejb-4.5.1/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java?rev=1420070&r1=1420069&r2=1420070&view=diff
==============================================================================
--- 
openejb/branches/openejb-4.5.1/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java
 (original)
+++ 
openejb/branches/openejb-4.5.1/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java
 Tue Dec 11 10:16:18 2012
@@ -497,18 +497,22 @@ public class DeploymentsElementTest exte
 
     @Test
     public void invalidDir_notReadable() throws Exception {
-        exceptions.expect(RuntimeException.class);
-        exceptions.expectMessage("Deployments dir=");
-        exceptions.expectMessage("Not readable");
-        exceptions.expectMessage("myapps");
-        final Server server = new Server();
+        if (!System.getProperty("os.name", 
"unknown").toLowerCase().startsWith("win")) {
 
-        final File dir = server.deploymentsDir("myapps");
-        assertTrue(dir.setReadable(false));
+            //File.setReadable(false) does nothing on win platforms
 
-        final OpenEjbConfiguration configuration = server.init();
+            exceptions.expect(RuntimeException.class);
+            exceptions.expectMessage("Deployments dir=");
+            exceptions.expectMessage("Not readable");
+            exceptions.expectMessage("myapps");
+            final Server server = new Server();
 
-        assertEquals(0, configuration.containerSystem.applications.size());
+            final File dir = server.deploymentsDir("myapps");
+
+            assertTrue(dir.setReadable(false));
+            final OpenEjbConfiguration configuration = server.init();
+            assertEquals(0, configuration.containerSystem.applications.size());
+        }
     }
 
     @Test
@@ -548,20 +552,24 @@ public class DeploymentsElementTest exte
 
     @Test
     public void invalidFile_notReadable() throws Exception {
-        exceptions.expect(RuntimeException.class);
-        exceptions.expectMessage("Deployments file=");
-        exceptions.expectMessage("Not readable");
-        exceptions.expectMessage("myapp.jar");
+        if (!System.getProperty("os.name", 
"unknown").toLowerCase().startsWith("win")) {
 
-        final Server server = new Server();
+            //File.setReadable(false) does nothing on win platforms
 
-        final File file = server.deploymentsFile("myapp.jar");
-        assertTrue(file.createNewFile());
-        assertTrue(file.setReadable(false));
+            exceptions.expect(RuntimeException.class);
+            exceptions.expectMessage("Deployments file=");
+            exceptions.expectMessage("Not readable");
+            exceptions.expectMessage("myapp.jar");
 
-        final OpenEjbConfiguration configuration = server.init();
+            final Server server = new Server();
 
-        assertEquals(0, configuration.containerSystem.applications.size());
+            final File file = server.deploymentsFile("myapp.jar");
+            assertTrue(file.createNewFile());
+            assertTrue(file.setReadable(false));
+
+            final OpenEjbConfiguration configuration = server.init();
+            assertEquals(0, configuration.containerSystem.applications.size());
+        }
     }
 
     /**


Reply via email to