subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v...@apache.org
Subject svn commit: r1352411 - /subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
Date Thu, 21 Jun 2012 05:03:52 GMT
Author: vmpn
Date: Thu Jun 21 05:03:52 2012
New Revision: 1352411

URL: http://svn.apache.org/viewvc?rev=1352411&view=rev
Log:
JavaHL: Factor out test username and password into shared constants allowing
for reuse by child classes

[ in subversion/bindings/javahl/test/org/tigris/subversion/javahl/ ]

* SVNTests.java:
  (USERNAME, PASSWORD): make test username and password available as constants
  (DefaultPromptUserPassword): make the class protected.

Modified:
    subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java

Modified: subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=1352411&r1=1352410&r2=1352411&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
Thu Jun 21 05:03:52 2012
@@ -145,6 +145,16 @@ class SVNTests extends TestCase
     protected static String rootUrl;
 
     /**
+     * Username to use in tests
+     */
+    protected final static String USERNAME = "jrandom";
+    
+    /**
+     * Password to use in tests
+     */
+    protected final static String PASSWORD = "rayjandom";
+    
+    /**
      * Create a JUnit <code>TestCase</code> instance.
      */
     protected SVNTests()
@@ -276,7 +286,7 @@ class SVNTests extends TestCase
         this.client = new SVNClient();
         this.client.notification2(new MyNotifier());
         this.client.setPrompt(new DefaultPromptUserPassword());
-        this.client.username("jrandom");
+        this.client.username(USERNAME);
         this.client.setProgressCallback(new DefaultProgressListener());
         this.client.setConfigDirectory(this.conf.getAbsolutePath());
         this.expectedCommitItems = new HashMap<String, MyCommitItem>();
@@ -284,7 +294,7 @@ class SVNTests extends TestCase
     /**
      * the default prompt : never prompts the user, provides defaults answers
      */
-    private static class DefaultPromptUserPassword implements UserPasswordCallback
+    protected static class DefaultPromptUserPassword implements UserPasswordCallback
     {
 
         public int askTrustSSLServer(String info, boolean allowPermanently)
@@ -304,12 +314,12 @@ class SVNTests extends TestCase
 
         public String getPassword()
         {
-            return "rayjandom";
+            return PASSWORD;
         }
 
         public String getUsername()
         {
-            return "jrandom";
+            return USERNAME;
         }
 
         public boolean prompt(String realm, String username)



Mime
View raw message