[dna-commits] DNA SVN: r972 - in trunk/extensions/dna-connector-svn/src: main/resources/org/jboss/dna/connector/svn and 1 other directories.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Thu Jun 4 14:13:04 EDT 2009


Author: rhauch
Date: 2009-06-04 14:13:03 -0400 (Thu, 04 Jun 2009)
New Revision: 972

Added:
   trunk/extensions/dna-connector-svn/src/main/resources/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18n.properties
   trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18nTest.java
Removed:
   trunk/extensions/dna-connector-svn/src/main/resources/org/jboss/dna/connector/svn/SVNConnectorI18n.properties
Modified:
   trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18n.java
   trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java
   trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryUtil.java
   trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNConnectorTestUtil.java
   trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorCreateWorspaceTest.java
Log:
Many errors in the SVN connector tests, and the I18n files are all messed up.

Modified: trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18n.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18n.java	2009-06-04 16:32:16 UTC (rev 971)
+++ trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18n.java	2009-06-04 18:13:03 UTC (rev 972)
@@ -35,11 +35,8 @@
     public static I18n connectorName;
     public static I18n nodeDoesNotExist;
     public static I18n nodeIsActuallyUnknow;
-    public static I18n nodeTypeIsNotSupported;
     public static I18n propertyIsRequired;
     public static I18n errorSerializingCachePolicyInSource;
-    public static I18n objectFoundInJndiWasNotCache;
-    public static I18n objectFoundInJndiWasNotCacheFactory;
     public static I18n locationInRequestMustHavePath;
     public static I18n sourceIsReadOnly;
     public static I18n sourceDoesNotSupportCreatingWorkspaces;
@@ -49,7 +46,6 @@
     public static I18n pathForPredefinedWorkspaceDoesNotExist;
     public static I18n pathForPredefinedWorkspaceIsNotDirectory;
     public static I18n pathForPredefinedWorkspaceCannotBeRead;
-    public static I18n worspaceDoesNotExist;
     public static I18n workspaceDoesNotExist;
     public static I18n pathForDefaultWorkspaceDoesNotExist;
     public static I18n pathForDefaultWorkspaceIsNotDirectory;

Modified: trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java	2009-06-04 16:32:16 UTC (rev 971)
+++ trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java	2009-06-04 18:13:03 UTC (rev 972)
@@ -403,7 +403,7 @@
             }
             if (!found) {
                 request.setError(new InvalidWorkspaceException(
-                                                               SVNRepositoryConnectorI18n.worspaceDoesNotExist.text(workspaceName)));
+                                                               SVNRepositoryConnectorI18n.workspaceDoesNotExist.text(workspaceName)));
                 return;
             }
         }
@@ -800,7 +800,7 @@
      * @param message - comment for the creation.
      * @throws SVNException - if during the creation, there is an error.
      */
-    @SuppressWarnings("unused")
+    @SuppressWarnings( "unused" )
     private void mkdir( SVNRepository repos,
                         String root,
                         String childName,
@@ -825,7 +825,7 @@
      * @param message
      * @throws SVNException
      */
-    @SuppressWarnings("unused")
+    @SuppressWarnings( "unused" )
     private void newFile( String path,
                           String file,
                           byte[] content,
@@ -954,7 +954,7 @@
 
     }
 
-    @SuppressWarnings("unused")
+    @SuppressWarnings( "unused" )
     private byte[] getContent( Object[] objs ) {
         byte[] content = null;
         for (Object object : objs) {
@@ -966,7 +966,7 @@
         return content;
     }
 
-    @SuppressWarnings("unused")
+    @SuppressWarnings( "unused" )
     private Object[] values( Collection<Property> childNodeProperties ) {
         Set<Object> result = new HashSet<Object>();
         for (Property property : childNodeProperties) {
@@ -984,10 +984,10 @@
                 throw new RepositorySourceException(getSourceName(), msg.text(getSourceName(), request));
             }
             // TODO
-//             if (!segment.getName().getNamespaceUri().equals(defaultNamespaceUri)) {
-//                I18n msg = SVNRepositoryConnectorI18n.onlyTheDefaultNamespaceIsAllowed;
-//                throw new RepositorySourceException(getSourceName(), msg.text(getSourceName(), request));
-//            }
+            // if (!segment.getName().getNamespaceUri().equals(defaultNamespaceUri)) {
+            // I18n msg = SVNRepositoryConnectorI18n.onlyTheDefaultNamespaceIsAllowed;
+            // throw new RepositorySourceException(getSourceName(), msg.text(getSourceName(), request));
+            // }
         }
     }
 

Modified: trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryUtil.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryUtil.java	2009-06-04 16:32:16 UTC (rev 971)
+++ trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryUtil.java	2009-06-04 18:13:03 UTC (rev 972)
@@ -16,9 +16,7 @@
 import org.tmatesoft.svn.core.wc.SVNWCUtil;
 
 /**
- * 
  * @author Serge Pagop
- *
  */
 public class SVNRepositoryUtil {
 
@@ -73,7 +71,6 @@
         return kind;
     }
 
-
     /**
      * Create a {@link SVNRepository} from a http protocol.
      * 
@@ -84,8 +81,7 @@
      */
     public static SVNRepository createRepository( String url,
                                                   String username,
-                                                  String password
-                                                  ) {
+                                                  String password ) {
         // for DAV (over http and https)
         DAVRepositoryFactory.setup();
         // For File
@@ -196,7 +192,6 @@
         return false;
     }
 
-    
     public static boolean exists( SVNRepository repository,
                                   String path ) {
         try {

Deleted: trunk/extensions/dna-connector-svn/src/main/resources/org/jboss/dna/connector/svn/SVNConnectorI18n.properties
===================================================================
--- trunk/extensions/dna-connector-svn/src/main/resources/org/jboss/dna/connector/svn/SVNConnectorI18n.properties	2009-06-04 16:32:16 UTC (rev 971)
+++ trunk/extensions/dna-connector-svn/src/main/resources/org/jboss/dna/connector/svn/SVNConnectorI18n.properties	2009-06-04 18:13:03 UTC (rev 972)
@@ -1,53 +0,0 @@
-#
-# JBoss DNA (http://www.jboss.org/dna)
-# See the COPYRIGHT.txt file distributed with this work for information
-# regarding copyright ownership.  Some portions may be licensed
-# to Red Hat, Inc. under one or more contributor license agreements.
-# See the AUTHORS.txt file in the distribution for a full listing of 
-# individual contributors. 
-#
-# JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
-# is licensed to you under the terms of the GNU Lesser General Public License as
-# published by the Free Software Foundation; either version 2.1 of
-# the License, or (at your option) any later version.
-#
-# JBoss DNA is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this software; if not, write to the Free
-# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-#
-
-connectorName = SVN Connector
-workspaceDoesNotExist = The workspace "{0}" does not exist
-nodeDoesNotExist = This node kind is missing at {0}
-locationInRequestMustHavePath = {0} requires a path in the request\: {1}
-nodeIsActuallyUnknow =  This node kind is actually unknown {0}
-propertyIsRequired = The {0} property is required but has no value
-errorSerializingCachePolicyInSource = Error serializing a {0} instance owned by the {1} SVNRepositorySource
-objectFoundInJndiWasNotSVNRepository = Object in JNDI at {0} found by SVNRepositorySource {1} was expected to be a typ of org.tmatesoft.svn.core.io.SVNRepository but instead was {2}
-objectFoundInJndiWasNotSVNRepositoryFactory =Object in JNDI at {0} found by SVNRepositorySource {1} was expected to be a typ of org.tmatesoft.svn.core.io.SVNRepositoryFactory but instead was {2}
-sourceIsReadOnly = {0} is a read-only source; no updates are allowed
-sourceDoesNotSupportCreatingWorkspaces = {0} is a source that does not allow creating workspaces
-sourceDoesNotSupportCloningWorkspaces = {0} is a source that does not allow cloning workspaces
-sourceDoesNotSupportDeletingWorkspaces = {0} is a source that does not allow deleting workspaces
-connectingFailureOrUserAuthenticationProblem=failure occured while connecting to the repository {0} or the user's authentication failed
-workspaceDoesNotExist = The workspace "{0}" does not exist
-pathForDefaultWorkspaceDoesNotExist = The path "{0}" for the default workspace for the file system source "{1}" does not represent an existing directory
-pathForDefaultWorkspaceIsNotDirectory = The path "{0}" for the default workspace for the file system source "{1}" is actually a path to an existing file
-pathForDefaultWorkspaceCannotBeRead = The path "{0}" for the default workspace for the file system source "{1}" cannot be read
-pathForPredefinedWorkspaceDoesNotExist = The path "{0}" for the predefined workspace for the file system source "{1}" does not represent an existing directory
-pathForPredefinedWorkspaceIsNotDirectory = The path "{0}" for the predefined workspace for the file system source "{1}" is actually a path to an existing file
-pathForPredefinedWorkspaceCannotBeRead = The path "{0}" for the predefined workspace for the file system source "{1}" cannot be read
-sameNameSiblingsAreNotAllowed = {0} does not allow same name siblings on nodes: {1}
-onlyTheDefaultNamespaceIsAllowed = {0} requires node names use the default namespace: {1}
-unableToCreateWorkspaces ={0} does not allow creating new workspaces (request was to create "{1}")
-locationInRequestMustHavePath = {0} requires a path in the request: {1}
-sameNameSiblingsAreNotAllowed = {0} does not allow same name siblings on nodes: {1}
-onlyTheDefaultNamespaceIsAllowed = {0} requires node names use the default namespace: {1}
-sourceIsReadOnly = {0} is a read-only source; no updates are allowed
-unableToCreateWorkspaces = {0} does not allow creating new workspaces (request was to create "{1}")
\ No newline at end of file

Copied: trunk/extensions/dna-connector-svn/src/main/resources/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18n.properties (from rev 971, trunk/extensions/dna-connector-svn/src/main/resources/org/jboss/dna/connector/svn/SVNConnectorI18n.properties)
===================================================================
--- trunk/extensions/dna-connector-svn/src/main/resources/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18n.properties	                        (rev 0)
+++ trunk/extensions/dna-connector-svn/src/main/resources/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18n.properties	2009-06-04 18:13:03 UTC (rev 972)
@@ -0,0 +1,45 @@
+#
+# JBoss DNA (http://www.jboss.org/dna)
+# See the COPYRIGHT.txt file distributed with this work for information
+# regarding copyright ownership.  Some portions may be licensed
+# to Red Hat, Inc. under one or more contributor license agreements.
+# See the AUTHORS.txt file in the distribution for a full listing of 
+# individual contributors. 
+#
+# JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+# is licensed to you under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# JBoss DNA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+connectorName = SVN Connector
+nodeDoesNotExist = This node kind is missing at {0}
+nodeIsActuallyUnknow =  This node kind is actually unknown {0}
+propertyIsRequired = The {0} property is required but has no value
+errorSerializingCachePolicyInSource = Error serializing a {0} instance owned by the {1} SVNRepositorySource
+sourceIsReadOnly = {0} is a read-only source; no updates are allowed
+sourceDoesNotSupportCreatingWorkspaces = {0} is a source that does not allow creating workspaces
+sourceDoesNotSupportCloningWorkspaces = {0} is a source that does not allow cloning workspaces
+sourceDoesNotSupportDeletingWorkspaces = {0} is a source that does not allow deleting workspaces
+connectingFailureOrUserAuthenticationProblem=failure occured while connecting to the repository {0} or the user's authentication failed
+workspaceDoesNotExist = The workspace "{0}" does not exist
+pathForDefaultWorkspaceDoesNotExist = The path "{0}" for the default workspace for the file system source "{1}" does not represent an existing directory
+pathForDefaultWorkspaceIsNotDirectory = The path "{0}" for the default workspace for the file system source "{1}" is actually a path to an existing file
+pathForDefaultWorkspaceCannotBeRead = The path "{0}" for the default workspace for the file system source "{1}" cannot be read
+pathForPredefinedWorkspaceDoesNotExist = The path "{0}" for the predefined workspace for the file system source "{1}" does not represent an existing directory
+pathForPredefinedWorkspaceIsNotDirectory = The path "{0}" for the predefined workspace for the file system source "{1}" is actually a path to an existing file
+pathForPredefinedWorkspaceCannotBeRead = The path "{0}" for the predefined workspace for the file system source "{1}" cannot be read
+sameNameSiblingsAreNotAllowed = {0} does not allow same name siblings on nodes: {1}
+onlyTheDefaultNamespaceIsAllowed = {0} requires node names use the default namespace: {1}
+locationInRequestMustHavePath = {0} requires a path in the request: {1}
+unableToCreateWorkspaces = {0} does not allow creating new workspaces (request was to create "{1}")
\ No newline at end of file

Modified: trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNConnectorTestUtil.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNConnectorTestUtil.java	2009-06-04 16:32:16 UTC (rev 971)
+++ trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNConnectorTestUtil.java	2009-06-04 18:13:03 UTC (rev 972)
@@ -127,7 +127,7 @@
     }
 
     public static String createURL( String src,
-                                    String dst ) throws IOException {
+                                    String dst ) throws IOException, SVNException {
         // First we need to find the absolute path. Note that Maven always runs the tests from the project's directory,
         // so use new File to create an instance at the current location ...
         File mySrc = new File(src);
@@ -138,8 +138,16 @@
         FileUtil.copy(mySrc, myDst);
 
         // Now set the two path roots
-        String url = myDst.getCanonicalFile().toURI().toURL().toString();
-        return url.replaceFirst("file:/", "file://localhost/");
+        String url = myDst.getCanonicalFile().toURI().toURL().toExternalForm();
+
+        url = url.replaceFirst("file:/", "file://localhost/");
+
+        // Have to decode the URL ...
+        SVNURL encodedUrl = SVNURL.parseURIEncoded(url);
+        url = encodedUrl.toDecodedString();
+
+        if (!url.endsWith("/")) url = url + "/";
+        return url;
     }
 
     @SuppressWarnings( "unchecked" )

Modified: trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorCreateWorspaceTest.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorCreateWorspaceTest.java	2009-06-04 16:32:16 UTC (rev 971)
+++ trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorCreateWorspaceTest.java	2009-06-04 18:13:03 UTC (rev 972)
@@ -12,8 +12,8 @@
 
 public class SVNRepositoryConnectorCreateWorspaceTest extends WorkspaceConnectorTest {
 
-    
     private String repositoryRootURL;
+
     /**
      * {@inheritDoc}
      * 
@@ -22,7 +22,7 @@
     @Override
     protected RepositorySource setUpSource() throws Exception {
         repositoryRootURL = SVNConnectorTestUtil.createURL("src/test/resources/dummy_svn_repos", "target/copy_of dummy_svn_repos");
-        String[] predefinedWorkspaceNames = new String[]{repositoryRootURL + "trunk", repositoryRootURL + "tags"};
+        String[] predefinedWorkspaceNames = new String[] {repositoryRootURL + "trunk", repositoryRootURL + "tags"};
         SVNRepositorySource source = new SVNRepositorySource();
         source.setName("Test Repository");
         source.setUsername("sp");
@@ -31,10 +31,10 @@
         source.setPredefinedWorkspaceNames(predefinedWorkspaceNames);
         source.setDirectoryForDefaultWorkspace(predefinedWorkspaceNames[0]);
         source.setCreatingWorkspacesAllowed(true);
-        
+
         return source;
     }
-    
+
     /**
      * {@inheritDoc}
      * 
@@ -62,9 +62,9 @@
      */
     @Override
     protected String[] generateValidNamesForNewWorkspaces() {
-        return new String[] { repositoryRootURL + "branches"};
+        return new String[] {repositoryRootURL + "branches"};
     }
-    
+
     @Test
     public void shouldReturnListOfWorkspacesMatchingRepositoryURLs() throws Exception {
         // The the actual names of the workspaces ...
@@ -73,7 +73,7 @@
             Workspace workspace = graph.useWorkspace(workspaceName);
             workspaceNames.add(workspace.getName());
         }
-        
+
         assertThat(workspaceNames.remove(repositoryRootURL + "trunk"), is(true));
         assertThat(workspaceNames.remove(repositoryRootURL + "tags"), is(true));
         assertThat(workspaceNames.isEmpty(), is(true));

Added: trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18nTest.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18nTest.java	                        (rev 0)
+++ trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18nTest.java	2009-06-04 18:13:03 UTC (rev 972)
@@ -0,0 +1,35 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of 
+ * individual contributors. 
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.connector.svn;
+
+import org.jboss.dna.common.AbstractI18nTest;
+
+/**
+ */
+public class SVNRepositoryConnectorI18nTest extends AbstractI18nTest {
+
+    public SVNRepositoryConnectorI18nTest() {
+        super(SVNRepositoryConnectorI18n.class);
+    }
+}


Property changes on: trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorI18nTest.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the dna-commits mailing list