db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r515136 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java
Date Tue, 06 Mar 2007 14:53:23 GMT
Author: rhillegas
Date: Tue Mar  6 06:53:22 2007
New Revision: 515136

URL: http://svn.apache.org/viewvc?view=rev&rev=515136
Log:
DERBY-2378: Committed derby-2378-01.diff, removing SecureServerTests's dependencies on non-public
apis.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java?view=diff&rev=515136&r1=515135&r2=515136
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java
Tue Mar  6 06:53:22 2007
@@ -39,10 +39,7 @@
 import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
-import org.apache.derby.iapi.reference.Property;
-import org.apache.derby.iapi.tools.i18n.LocalizedResource;
 import org.apache.derby.drda.NetworkServerControl;
-import org.apache.derby.impl.drda.NetworkServerControlImpl;
 
 /**
  * This Junit test class tests whether the server comes up under a security
@@ -95,7 +92,7 @@
 
     private static final Outcome FAILED_NO_AUTHENTICATION = new Outcome( false, authenticationFailure()
);
     private static final Outcome RUNNING_SECURITY_NOT_BOOTED = new Outcome( true, "" );
-    private static final Outcome RUNNING_SECURITY_BOOTED = new Outcome( true, getTextMessage(
"DRDA_SecurityInstalled.I" ) );
+    private static final Outcome RUNNING_SECURITY_BOOTED = new Outcome( true,  serverBootedOK()
);
 
         
     // startup state
@@ -108,7 +105,6 @@
     // helper state for intercepting server error messages
     private InputStream[]  _inputStreamHolder;
 
-    private static  LocalizedResource   _messageResolver;
     
     ///////////////////////////////////////////////////////////////////////////////////
     //
@@ -238,8 +234,7 @@
 
         if ( setUnsecureOption )
         {
-            list.add
-                ( '-' + NetworkServerControlImpl.DASHARGS[ NetworkServerControlImpl.DASHARG_UNSECURE
] );
+            list.add( "-noSecurityManager" );
         }
         
         String[]    result = new String[ list.size() ];
@@ -328,36 +323,18 @@
         return new String( inputBuffer, 0, bytesRead );
     }
 
-    private static  LocalizedResource   getMessageResolver()
+    private static  String  authenticationFailure()
     {
-        if ( _messageResolver == null )
-        {
-            _messageResolver = new LocalizedResource( null, null, "org.apache.derby.loc.drda.messages"
);
-        }
-
-        return _messageResolver;
+        return "Network Server startup failed. " +
+            "User authentication should be enabled " +
+            "before the Network Server installs a security manager. " +
+            "Please either set the 'derby.connection.requireAuthentication' " +
+            "system property to true or run the network server with the '-noSecurityManager'
option.";
     }
 
-    private static  String  getTextMessage( String key )
-    {
-        return getTextMessage( key, new String[]{} );
-    }
-    private static  String  getTextMessage( String key, Object[] args )
+    private static  String  serverBootedOK()
     {
-        return getMessageResolver().getTextMessage( key, args );
-    }
-    
-    private static  String  authenticationFailure()
-    {
-        return getTextMessage
-            (
-             "DRDA_NoAuthentication.S",
-             new String[]
-                {
-                    Property.REQUIRE_AUTHENTICATION_PARAMETER,
-                    NetworkServerControlImpl.DASHARGS[  NetworkServerControlImpl.DASHARG_UNSECURE
]
-                }
-             );
+        return "Security manager installed using the Basic server security policy.";
     }
 
     private boolean serverCameUp()



Mime
View raw message