maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r956830 - in /maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs: maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/ maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provide...
Date Tue, 22 Jun 2010 09:13:49 GMT
Author: oching
Date: Tue Jun 22 09:13:47 2010
New Revision: 956830

URL: http://svn.apache.org/viewvc?rev=956830&view=rev
Log:
[SCM-558] Add support for 'mkdir' command
o implement mkdir command for cvsjava
o run tck test for mkdir for cvsjava

Added:
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/AbstractCvsMkdirCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/CvsJavaMkdirCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/CvsJavaMkdirCommandTckTest.java
Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/mkdir/CvsExeMkdirCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/CvsJavaScmProvider.java

Added: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/AbstractCvsMkdirCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/AbstractCvsMkdirCommand.java?rev=956830&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/AbstractCvsMkdirCommand.java
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/AbstractCvsMkdirCommand.java
Tue Jun 22 09:13:47 2010
@@ -0,0 +1,66 @@
+package org.apache.maven.scm.provider.cvslib.command.mkdir;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.scm.CommandParameter;
+import org.apache.maven.scm.CommandParameters;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.command.Command;
+import org.apache.maven.scm.command.mkdir.AbstractMkdirCommand;
+import org.apache.maven.scm.command.mkdir.MkdirScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+
+/**
+ * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
+ * @version $Id$
+ */
+public abstract class AbstractCvsMkdirCommand
+    extends AbstractMkdirCommand
+{
+    /** {@inheritDoc} */
+    protected MkdirScmResult executeMkdirCommand( ScmProviderRepository repository, ScmFileSet
fileSet, String message,
+                                                  boolean createInLocal )
+        throws ScmException
+    {
+        CommandParameters parameters = new CommandParameters();
+
+        parameters.setString( CommandParameter.MESSAGE, message == null ? "" : message );
+
+        parameters.setString( CommandParameter.BINARY, "false" );
+
+        // just invoke add command
+        Command cmd = getAddCommand();
+        cmd.setLogger( getLogger() );
+
+        ScmResult addResult = cmd.execute( repository, fileSet, parameters );
+
+        if ( !addResult.isSuccess() )
+        {
+            return new MkdirScmResult( addResult.getCommandLine().toString(), "The cvs command
failed.",
+                                       addResult.getCommandOutput(), false );
+        }
+
+        return new MkdirScmResult( addResult.getCommandLine().toString(), fileSet.getFileList()
);
+    }
+
+    protected abstract Command getAddCommand();
+}

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/mkdir/CvsExeMkdirCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/mkdir/CvsExeMkdirCommand.java?rev=956830&r1=956829&r2=956830&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/mkdir/CvsExeMkdirCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/mkdir/CvsExeMkdirCommand.java
Tue Jun 22 09:13:47 2010
@@ -19,14 +19,8 @@ package org.apache.maven.scm.provider.cv
  * under the License.
  */
 
-import org.apache.maven.scm.CommandParameter;
-import org.apache.maven.scm.CommandParameters;
-import org.apache.maven.scm.ScmException;
-import org.apache.maven.scm.ScmFileSet;
-import org.apache.maven.scm.ScmResult;
-import org.apache.maven.scm.command.mkdir.AbstractMkdirCommand;
-import org.apache.maven.scm.command.mkdir.MkdirScmResult;
-import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.command.Command;
+import org.apache.maven.scm.provider.cvslib.command.mkdir.AbstractCvsMkdirCommand;
 import org.apache.maven.scm.provider.cvslib.cvsexe.command.add.CvsExeAddCommand;
 
 /**
@@ -34,30 +28,10 @@ import org.apache.maven.scm.provider.cvs
  * @version $Id$
  */
 public class CvsExeMkdirCommand
-    extends AbstractMkdirCommand
+    extends AbstractCvsMkdirCommand
 {
-    protected MkdirScmResult executeMkdirCommand( ScmProviderRepository repository, ScmFileSet
fileSet, String message,
-                                                  boolean createInLocal )
-        throws ScmException
+    protected Command getAddCommand()
     {
-        CommandParameters parameters = new CommandParameters();
-
-        parameters.setString( CommandParameter.MESSAGE, message == null ? "" : message );
-
-        parameters.setString( CommandParameter.BINARY, "false" );
-
-        // just invoke add command
-        CvsExeAddCommand cmd = new CvsExeAddCommand();
-        cmd.setLogger( getLogger() );
-
-        ScmResult addResult = cmd.execute( repository, fileSet, parameters );
-
-        if ( !addResult.isSuccess() )
-        {
-            return new MkdirScmResult( addResult.getCommandLine().toString(), "The cvs command
failed.",
-                                       addResult.getCommandOutput(), false );
-        }
-
-        return new MkdirScmResult( addResult.getCommandLine().toString(), fileSet.getFileList()
);
+        return new CvsExeAddCommand();
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/CvsJavaScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/CvsJavaScmProvider.java?rev=956830&r1=956829&r2=956830&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/CvsJavaScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/CvsJavaScmProvider.java
Tue Jun 22 09:13:47 2010
@@ -30,6 +30,7 @@ import org.apache.maven.scm.provider.cvs
 import org.apache.maven.scm.provider.cvslib.cvsjava.command.export.CvsJavaExportCommand;
 import org.apache.maven.scm.provider.cvslib.cvsjava.command.list.CvsJavaListCommand;
 import org.apache.maven.scm.provider.cvslib.cvsjava.command.login.CvsJavaLoginCommand;
+import org.apache.maven.scm.provider.cvslib.cvsjava.command.mkdir.CvsJavaMkdirCommand;
 import org.apache.maven.scm.provider.cvslib.cvsjava.command.remove.CvsJavaRemoveCommand;
 import org.apache.maven.scm.provider.cvslib.cvsjava.command.status.CvsJavaStatusCommand;
 import org.apache.maven.scm.provider.cvslib.cvsjava.command.tag.CvsJavaTagCommand;
@@ -124,6 +125,6 @@ public class CvsJavaScmProvider
     /** {@inheritDoc} */
     protected Command getMkdirCommand()
     {
-        return null;
+        return new CvsJavaMkdirCommand();
     }
 }

Added: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/CvsJavaMkdirCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/CvsJavaMkdirCommand.java?rev=956830&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/CvsJavaMkdirCommand.java
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/CvsJavaMkdirCommand.java
Tue Jun 22 09:13:47 2010
@@ -0,0 +1,37 @@
+package org.apache.maven.scm.provider.cvslib.cvsjava.command.mkdir;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.scm.command.Command;
+import org.apache.maven.scm.provider.cvslib.command.mkdir.AbstractCvsMkdirCommand;
+import org.apache.maven.scm.provider.cvslib.cvsjava.command.add.CvsJavaAddCommand;
+
+/**
+ * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
+ * @version $Id$
+ */
+public class CvsJavaMkdirCommand
+    extends AbstractCvsMkdirCommand
+{
+    protected Command getAddCommand()
+    {
+        return new CvsJavaAddCommand();
+    }
+}

Added: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/CvsJavaMkdirCommandTckTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/CvsJavaMkdirCommandTckTest.java?rev=956830&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/CvsJavaMkdirCommandTckTest.java
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/mkdir/CvsJavaMkdirCommandTckTest.java
Tue Jun 22 09:13:47 2010
@@ -0,0 +1,33 @@
+package org.apache.maven.scm.provider.cvslib.cvsjava.command.mkdir;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.scm.provider.cvslib.command.mkdir.CvsMkdirCommandTckTest;
+
+/**
+ * This test tests the mkdir command.
+ * 
+ * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
+ * @version $Id$
+ */
+public class CvsJavaMkdirCommandTckTest
+    extends CvsMkdirCommandTckTest
+{
+}



Mime
View raw message