You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2011/03/14 18:55:58 UTC

svn commit: r1081494 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/derbynet/ServerPropertiesTest.java junit/BaseTestCase.java junit/OsName.java

Author: kmarsden
Date: Mon Mar 14 17:55:58 2011
New Revision: 1081494

URL: http://svn.apache.org/viewvc?rev=1081494&view=rev
Log:
DERBY-4319 hang in suites.all with ibm 1.5 on AIX after ttestDefaultProperties

disable for now ttestDefaultProperties and ttestSetPortPriority on AIX IBM 1.5, which can make the test fail.  This does not fix the issue.
Also add BaseTestCase.isPlatform(String) method and OsName class to faciltate platform exclusions from test runs.


Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/OsName.java
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java?rev=1081494&r1=1081493&r2=1081494&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java Mon Mar 14 17:55:58 2011
@@ -37,6 +37,7 @@ import org.apache.derbyTesting.junit.Bas
 import org.apache.derbyTesting.junit.Derby;
 import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.NetworkServerTestSetup;
+import org.apache.derbyTesting.junit.OsName;
 import org.apache.derbyTesting.junit.SecurityManagerSetup;
 import org.apache.derbyTesting.junit.SupportFilesSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
@@ -81,8 +82,12 @@ public class ServerPropertiesTest  exten
         // this fixture doesn't use a client/server setup, instead does the 
         // relevant starting/stopping inside the test
         // Add security manager policy that allows executing java commands
+        // omit on AIX JDK 1.5 for now as it is causing a hang DERBY-4319
+        // see also ttestDefaultProperties below
+        if (! (isPlatform(OsName.AIX) && isJava5())) {
         suite.addTest(decorateTest("ttestSetPortPriority", 
                 new String[] {}, new String[] {}, false));
+        }
         
         // test unfinished properties settings. 
         // decorateTest adds policy file and sets up properties
@@ -102,7 +107,9 @@ public class ServerPropertiesTest  exten
                 };
         // fixture hits error DRDA_MissingNetworkJar (Cannot find derbynet.jar) so,
         // only run with jars
-        if (TestConfiguration.loadingFromJars())
+        // DERBY-4319 
+        if (TestConfiguration.loadingFromJars() &&
+            (! (isPlatform(OsName.AIX) && isJava5())))
             suite.addTest(decorateTest("ttestDefaultProperties", 
                 badServerProperties, new String[] {}, true));
         

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java?rev=1081494&r1=1081493&r2=1081494&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java Mon Mar 14 17:55:58 2011
@@ -594,6 +594,29 @@ public abstract class BaseTestCase
     }
 
     /**
+     * Determine if there is a platform match with os.name.
+     * This method uses an exact equals. Other methods might be useful
+     * later for starts with.
+     * 
+     * @param osName value we want to check against the system property
+     *      os.name
+     * @return return true if osName is an exact match for osName
+     */
+    
+    public static final boolean isPlatform(String osName)  {
+
+        return getSystemProperty("os.name").equals(osName);
+    }
+    
+    /**
+     * Check if this is java 5
+     * @return true if java.version system property starts with 1.5
+     */
+    public static final boolean isJava5() {
+        return getSystemProperty("java.version").startsWith("1.5");
+    }
+   
+    /**
      * Check if we have old style (before Sun Java 1.7) Solaris interruptible
      * IO. On Sun Java 1.5 >= update 22 and Sun Java 1.6 this can be disabled
      * with Java option {@code -XX:-UseVMInterruptibleIO}. On Sun Java 1.7 it

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/OsName.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/OsName.java?rev=1081494&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/OsName.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/OsName.java Mon Mar 14 17:55:58 2011
@@ -0,0 +1,42 @@
+/*
+ *
+ * Derby - Class org.apache.derbyTesting.junit.OsName
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, 
+ * software distributed under the License is distributed on an 
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
+ * either express or implied. See the License for the specific 
+ * language governing permissions and limitations under the License.
+ */
+
+package org.apache.derbyTesting.junit;
+
+/**
+ * OsName is used to store constants for the System Property os.name 
+ * that can be passed to the BaseTestCase.isPlatform(String) method.
+ * Started this class with a few known values.
+ * TODO: Expand for all known os.names for platforms running Derby tests
+ *
+ */
+public class OsName {
+
+    
+    public static final String LINUX = "Linux";
+    public static final String MACOS = "Mac OS";
+    public static final String MACOSX = "Mac OS X";
+    public static final String AIX = "AIX";
+    public static final String OS400 = "OS/400";
+    public static final String ZOS = "z/OS";
+    public static final String WINDOWSXP = "Windows XP";
+    
+    
+}