[[[
    JavaHL: Expose additional methods publicly so that readonly tests can
use them to setup a single shared readonly test repository to speed up tests

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

    * SVNTests.java:
      (USERNAME, PASSWORD): Make test username and password publicly
available constants
      (setUp): Make the method public
      (DefaultPromptUserPassword): make the class public.
      (prompt): Return true so that the getPassword() and getUsername()
methods are called by the JNI code
      (getConf): New method to retreive test configuration directory
      (getGreeksRepoUrl): New method to retreive URL to the shared test repo
]]]
Index: 
subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
===================================================================
--- subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java 
(revision 1328758)
+++ subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java 
(working copy)
@@ -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()
@@ -221,7 +231,7 @@ class SVNTests extends TestCase
      * Standard initialization of one test
      * @throws Exception
      */
-    protected void setUp() throws Exception
+    public void setUp() throws Exception
     {
         super.setUp();
 
@@ -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
+    public static class DefaultPromptUserPassword implements 
UserPasswordCallback
     {
 
         public int askTrustSSLServer(String info, boolean allowPermanently)
@@ -304,22 +314,22 @@ 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)
         {
-            return false;
+            return true;
         }
 
         public boolean prompt(String realm, String username, boolean maySave)
         {
-            return false;
+            return true;
         }
 
         public String askQuestion(String realm, String question,
@@ -498,8 +508,30 @@ class SVNTests extends TestCase
         }
         return admDirName;
     }
+    
+       public File getConf()
+       {
+               return conf;
+       }
 
-    /**
+       public String getGreeksRepoUrl()
+       {
+               try
+               {
+                       return makeReposUrl(greekRepos).toString();
+               }
+               catch (SubversionException e)
+               {
+                       throw new RuntimeException(e);
+                       
+               }
+       }
+       
+       public void setTestBaseName(String testBaseName)
+       {
+               this.testBaseName = testBaseName;
+       }
+       /**
      * Represents the repository and (possibly) the working copy for
      * one test.
      */

Reply via email to