Author: rmannibucau
Date: Sun Mar 17 15:49:16 2013
New Revision: 1457467

URL: http://svn.apache.org/r1457467
Log:
because of rule usage to check exception test was arriving too late - making it 
eager

Modified:
    
tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java

Modified: 
tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java?rev=1457467&r1=1457466&r2=1457467&view=diff
==============================================================================
--- 
tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java
 (original)
+++ 
tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java
 Sun Mar 17 15:49:16 2013
@@ -497,7 +497,8 @@ public class DeploymentsElementTest exte
     @Test
     public void invalidDir_notReadable() throws Exception {
 
-        if (!System.getProperty("os.name", 
"unknown").toLowerCase().startsWith("win")) {
+        if (!System.getProperty("os.name", 
"unknown").toLowerCase().startsWith("win")
+                && !"root".equals(System.getProperty("user.name", "openejb"))) 
{
 
             //File.setReadable(false) does nothing on win platforms
 
@@ -510,10 +511,9 @@ public class DeploymentsElementTest exte
             final File dir = server.deploymentsDir("myapps");
 
             assertTrue(dir.setReadable(false));
-            if (!dir.canRead() && 
!"root".equals(System.getProperty("user.name", "openejb"))) { // else can't do 
the test
-                final OpenEjbConfiguration configuration = server.init();
-                assertEquals(0, 
configuration.containerSystem.applications.size());
-            }
+
+            final OpenEjbConfiguration configuration = server.init();
+            assertEquals(0, configuration.containerSystem.applications.size());
         }
     }
 
@@ -555,7 +555,8 @@ public class DeploymentsElementTest exte
     @Test
     public void invalidFile_notReadable() throws Exception {
 
-        if (!System.getProperty("os.name", 
"unknown").toLowerCase().startsWith("win")) {
+        if (!System.getProperty("os.name", 
"unknown").toLowerCase().startsWith("win")
+                && !"root".equals(System.getProperty("user.name", "openejb"))) 
{
 
             //File.setReadable(false) does nothing on win platforms
 
@@ -570,10 +571,8 @@ public class DeploymentsElementTest exte
             assertTrue(file.createNewFile());
             assertTrue(file.setReadable(false));
 
-            if (!file.canRead() && 
!"root".equals(System.getProperty("user.name", "openejb"))) { // else can't do 
the test
-                final OpenEjbConfiguration configuration = server.init();
-                assertEquals(0, 
configuration.containerSystem.applications.size());
-            }
+            final OpenEjbConfiguration configuration = server.init();
+            assertEquals(0, configuration.containerSystem.applications.size());
         }
     }
 


Reply via email to