You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm-commits@maven.apache.org by ol...@apache.org on 2010/07/30 10:14:30 UTC

svn commit: r980673 [3/5] - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev: ./ src/main/java/org/apache/maven/scm/provider/accurev/ src/main/java/org/apache/maven/scm/provider/accurev/cli/ src/main/java/org/apache/maven/scm/provider...

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateCommand.java?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateCommand.java Fri Jul 30 08:14:27 2010
@@ -20,10 +20,8 @@ package org.apache.maven.scm.provider.ac
  */
 
 import java.io.File;
-import java.util.ArrayList;
 import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.List;
 
 import org.apache.maven.scm.CommandParameter;
 import org.apache.maven.scm.CommandParameters;
@@ -40,9 +38,7 @@ import org.apache.maven.scm.provider.acc
 import org.apache.maven.scm.provider.accurev.AccuRevInfo;
 import org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository;
 import org.apache.maven.scm.provider.accurev.AccuRevVersion;
-import org.apache.maven.scm.provider.accurev.WorkSpace;
 import org.apache.maven.scm.provider.accurev.command.AbstractAccuRevCommand;
-import org.codehaus.plexus.util.StringUtils;
 
 public class AccuRevUpdateCommand
     extends AbstractAccuRevCommand
@@ -59,8 +55,6 @@ public class AccuRevUpdateCommand
         throws ScmException, AccuRevException
     {
 
-        ArrayList<File> updatedFiles = new ArrayList<File>();
-
         AccuRev accuRev = repository.getAccuRev();
 
         File basedir = fileSet.getBasedir();
@@ -72,119 +66,76 @@ public class AccuRevUpdateCommand
             throw new AccuRevException( "No workspace at " + basedir.getAbsolutePath() );
         }
 
-        boolean success = true;
+        String startRevision = getStartRevision( repository, parameters, info );
+
+        ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );
+
+        String updateTransactionId = null;
 
-        AccuRevVersion startVersion = getStartVersion( repository, parameters, info );
+        if ( scmVersion != null )
+        {
+            AccuRevVersion updateVersion = repository.getAccuRevVersion( scmVersion );
 
-        AccuRevVersion endVersion = getEndVersion( repository, parameters, info );
+            // Reparent if necessary
+            String newBasisStream = updateVersion.getBasisStream();
+            if ( newBasisStream != null
+                && ( !( newBasisStream.equals( info.getWorkSpace() ) || newBasisStream.equals( info.getBasis() ) ) ) )
+            {
+                getLogger().info( "Reparenting " + info.getWorkSpace() + " to " + newBasisStream );
+                accuRev.chws( basedir, info.getWorkSpace(), newBasisStream );
+            }
+
+            if ( !updateVersion.isNow() )
+            {
+                updateTransactionId = updateVersion.getTimeSpec();
+            }
+        }
 
-        String newBasisStream = endVersion.getBasisStream();
-        if ( newBasisStream != null && !newBasisStream.equals( info.getBasis() ) )
+        if ( updateTransactionId == null )
         {
-            getLogger().info( "Reparenting " + info.getWorkSpace() + " to " + newBasisStream );
-            success = accuRev.chws( basedir, info.getWorkSpace(), newBasisStream );
+            updateTransactionId = repository.getDepotTransactionId( info.getWorkSpace(), "now" );
         }
 
-        success = success && accuRev.update( basedir, endVersion.getTimeSpec(), updatedFiles );
+        String endRevision = repository.getRevision( info.getWorkSpace(), updateTransactionId );
+
+        List<File> updatedFiles = accuRev.update( basedir, updateTransactionId );
 
-        if ( success )
+        if ( updatedFiles != null )
         {
-            return new AccuRevUpdateScmResult( startVersion, endVersion, accuRev.getCommandLines(),
-                                               getScmFiles( updatedFiles, ScmFileStatus.UPDATED ) );
+            return new AccuRevUpdateScmResult( accuRev.getCommandLines(), getScmFiles( updatedFiles,
+                                                                                       ScmFileStatus.UPDATED ),
+                                               startRevision, endRevision );
         }
         else
         {
-            return new UpdateScmResult( accuRev.getCommandLines(), "AccuRev error", accuRev.getErrorOutput(), false );
+            return new AccuRevUpdateScmResult( accuRev.getCommandLines(), "AccuRev error", accuRev.getErrorOutput(),
+                                               null, null, false );
         }
     }
 
     /*
-     * If we are not capturing info for a changelog, return null. If start date is supplied then
-     * start version is the current workspace basis stream / start_date Otherwise get the current
-     * high water mark for the workspace as the start version.
+     * If we are not capturing info for a changelog then we don't need a start revision. Start date is used if supplied
+     * otherwise get the current high water mark for the workspace as the start version.
      */
-    private AccuRevVersion getStartVersion( AccuRevScmProviderRepository repository, CommandParameters parameters,
-                                            AccuRevInfo info )
+    private String getStartRevision( AccuRevScmProviderRepository repository, CommandParameters parameters,
+                                     AccuRevInfo info )
         throws ScmException, AccuRevException
     {
-        AccuRevVersion startVersion = null;
-
-        AccuRev accuRev = repository.getAccuRev();
 
         boolean runChangeLog = parameters.getBoolean( CommandParameter.RUN_CHANGELOG_WITH_UPDATE );
         Date startDate = parameters.getDate( CommandParameter.START_DATE, null );
+        String workspace = info.getWorkSpace();
 
-        if ( runChangeLog )
+        if ( !runChangeLog )
         {
-            if ( startDate == null )
-            {
-                // Get tran id before the update, and add one.
-                startVersion = new AccuRevVersion( info.getBasis(), 1 + getCurrentTransactionId( info.getWorkSpace(),
-                                                                                                 accuRev ) );
-            }
-            else
-            {
-                // Use the supplied date (assume same basis, TODO not strictly correct)
-                startVersion = new AccuRevVersion( info.getBasis(), startDate );
-            }
-        }
-        return startVersion;
-    }
-
-    /*
-     * End version timespec is used as the -t parameter to update. If a version is specified in
-     * parameters then we use that. If "now" or "highest" is specified as the timespec it is
-     * replaced with the "now" as a date, so that we can be 100% accurate in terms of the changelog.
-     * If no version is specified then we use the current workspace basis stream and "now" as a
-     * date.
-     */
-    private AccuRevVersion getEndVersion( AccuRevScmProviderRepository repository, CommandParameters parameters,
-                                          AccuRevInfo info )
-        throws ScmException
-    {
-        AccuRevVersion endVersion = null;
-        ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );
-
-        if ( scmVersion != null )
-        {
-            endVersion = repository.getAccuRevVersion( scmVersion );
+            return null;
         }
         else
         {
-            endVersion = new AccuRevVersion( info.getBasis(), (String) null );
+            return startDate == null ? repository.getWorkSpaceRevision( workspace )
+                            : repository.getRevision( workspace, startDate );
         }
-        return endVersion;
-    }
-
-    private long getCurrentTransactionId( String workSpaceName, AccuRev accuRev )
-        throws AccuRevException
-    {
-        // AccuRev does not have a way to get at this workspace info by name.
-        // So we have to do it the hard way...
 
-        Map<String, WorkSpace> workSpaces = new HashMap<String, WorkSpace>();
-
-        accuRev.showWorkSpaces( workSpaces );
-
-        WorkSpace workspace = workSpaces.get( workSpaceName );
-
-        if ( workspace == null )
-        {
-            // Must be a reftree
-            accuRev.showRefTrees( workSpaces );
-            workspace = workSpaces.get( workSpaceName );
-        }
-
-        if ( workspace == null )
-        {
-            getLogger().warn( "Can't find workspace " + workSpaceName );
-            if ( getLogger().isDebugEnabled() )
-            {
-                getLogger().warn( StringUtils.join( workSpaces.values().iterator(), "\n" ) );
-            }
-            return 0;
-        }
-        return workspace.getTransactionId();
     }
 
     public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateScmResult.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateScmResult.java?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateScmResult.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateScmResult.java Fri Jul 30 08:14:27 2010
@@ -22,8 +22,7 @@ package org.apache.maven.scm.provider.ac
 import java.util.List;
 
 import org.apache.maven.scm.ScmFile;
-import org.apache.maven.scm.command.update.UpdateScmResult;
-import org.apache.maven.scm.provider.accurev.AccuRevVersion;
+import org.apache.maven.scm.command.update.UpdateScmResultWithRevision;
 
 /**
  * Carry information about before and after transaction ids so we can run the changelog
@@ -31,33 +30,48 @@ import org.apache.maven.scm.provider.acc
  * @author ggardner
  */
 public class AccuRevUpdateScmResult
-    extends UpdateScmResult
+    extends UpdateScmResultWithRevision
 {
+    ;
 
-    private AccuRevVersion fromVersion;
+    private static final long serialVersionUID = -4896981432286000329L;
+    String fromRevision;
 
-    private AccuRevVersion toVersion;
-
-    public AccuRevUpdateScmResult( String commandLine, String providerMessage, String commandOutput, boolean success )
+    /**
+     * Failed constructor
+     * 
+     * @param commandLine
+     * @param providerMessage
+     * @param commandOutput
+     */
+    public AccuRevUpdateScmResult( String commandLine, String providerMessage, String commandOutput,
+                                   String fromRevision, String toRevision, boolean success )
     {
-        super( commandLine, providerMessage, commandOutput, success );
+        super( commandLine, providerMessage, commandOutput, toRevision, success );
+        this.fromRevision = fromRevision;
     }
 
-    public AccuRevUpdateScmResult( AccuRevVersion startVersion, AccuRevVersion endVersion, String commandLines,
-                                   List<ScmFile> updatedFiles )
+    /**
+     * Success constructor
+     * 
+     * @param startVersion
+     * @param endVersion
+     * @param commandLines
+     * @param updatedFiles
+     */
+    public AccuRevUpdateScmResult( String commandLines,List<ScmFile> updatedFiles,String fromRevision, String toRevision  )
     {
-        super( commandLines, updatedFiles );
-        this.fromVersion = startVersion;
-        this.toVersion = endVersion;
+        super( commandLines, updatedFiles, toRevision );
+        this.fromRevision = fromRevision;
     }
 
-    public AccuRevVersion getFromVersion()
+    public String getFromRevision()
     {
-        return fromVersion;
+        return fromRevision;
     }
 
-    public AccuRevVersion getToVersion()
+    public String getToRevision()
     {
-        return toVersion;
+        return getRevision();
     }
 }
\ No newline at end of file

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/util/QuotedPropertyParser.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/util/QuotedPropertyParser.java?rev=980673&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/util/QuotedPropertyParser.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/util/QuotedPropertyParser.java Fri Jul 30 08:14:27 2010
@@ -0,0 +1,148 @@
+package org.apache.maven.scm.provider.accurev.util;
+
+/*
+ * 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 java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author ggardner
+ */
+public final class QuotedPropertyParser
+{
+
+    private QuotedPropertyParser()
+    {
+
+    }
+
+    public static Map<String, String> parse( CharSequence seq )
+    {
+        Map<String, String> hashMap = new HashMap<String, String>();
+
+        parse( seq, hashMap );
+        return hashMap;
+    }
+
+    public static void parse( CharSequence string, Map<? super String, ? super String> propertyMap )
+    {
+
+        QuotedParseState state = QuotedParseState.KEY;
+        char quote = '\0';
+        StringBuffer buffer = new StringBuffer();
+        String propertyKey = "";
+
+        int i = 0; // where we are up to in the scan
+        int pos = 0; // where we have consumed into the buffer
+        while ( i < string.length() )
+        {
+            char current = string.charAt( i );
+            switch ( state )
+            {
+                case KEY:
+                    switch ( current )
+                    {
+                        case '"':
+                        case '\'':
+                            quote = current;
+                            state = QuotedParseState.IN_QUOTED_KEY;
+                            if ( i >= pos )
+                            {
+                                buffer.append( string.subSequence( pos, i ) );
+                            }
+                            pos = i + 1;
+                            break;
+                        case '=':
+                            if ( i >= pos )
+                            {
+                                buffer.append( string.subSequence( pos, i ) );
+                            }
+                            propertyKey = buffer.toString();
+                            buffer = new StringBuffer();
+                            state = QuotedParseState.VALUE;
+                            pos = i + 1;
+                            break;
+                    }
+                    break;
+
+                case VALUE:
+                    switch ( current )
+                    {
+                        case '"':
+                        case '\'':
+                            quote = current;
+                            state = QuotedParseState.IN_QUOTED_VALUE;
+                            if ( i >= pos )
+                            {
+                                buffer.append( string.subSequence( pos, i ) );
+                            }
+                            pos = i + 1;
+                            break;
+                        case '&':
+                            if ( i >= pos )
+                            {
+                                buffer.append( string.subSequence( pos, i ) );
+                            }
+                            propertyMap.put( propertyKey, buffer.toString() );
+                            pos = i + 1;
+                            buffer = new StringBuffer();
+                            state = QuotedParseState.KEY;
+                            break;
+                        default:
+                    }
+
+                    break;
+                case IN_QUOTED_KEY:
+                case IN_QUOTED_VALUE:
+                    if ( current == quote )
+                    {
+                        state =
+                            ( state == QuotedParseState.IN_QUOTED_KEY ) ? QuotedParseState.KEY : QuotedParseState.VALUE;
+                        if ( i >= pos )
+                        {
+                            buffer.append( string.subSequence( pos, i ) );
+                        }
+                        pos = i + 1;
+                    }
+                    break;
+                default:
+                    break;
+            }
+
+            i++;
+        }
+
+        if ( state == QuotedParseState.VALUE )
+        {
+            if ( i >= pos )
+            {
+                buffer.append( string.subSequence( pos, i ) );
+            }
+            propertyMap.put( propertyKey, buffer.toString() );
+        }
+    }
+
+    // Has to be down here to avoid a QDOX exception
+    public static enum QuotedParseState
+    {
+        KEY, IN_QUOTED_KEY, IN_QUOTED_VALUE, VALUE
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/util/QuotedPropertyParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/util/QuotedPropertyParser.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/index.apt?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/index.apt (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/index.apt Fri Jul 30 08:14:27 2010
@@ -34,23 +34,29 @@ Details
  
 URLS
 
- <<<scm:accurev:[user/pass[@host[:port]]][:streamName][:/project/path]>>>
+ <<<scm:accurev:[user/pass[@host[:port]]][:streamName][:?key=value&key=value...][:/project/path]>>>
  
  * <user/pass> See login below.
  
  * <@host:port> Specify the accurev server to connect to. If used all accurev commands will include a
  <<<-H host:port>>> argument.
- 
-   * <<TODO>> SystemProperty - "accuRevReplicas", host:port=replicaHost:port,..
-    
- * <streamName> is only useful to provide a "version" for initial checkouts. Only really required for HEAD/trunk type
- checkout such as done by the tck tests.
+     
+ * <streamName> provide a "version" for initial checkouts. Only really required for HEAD/trunk type
+ checkouts such as done by the tck tests.
 
+ * <?prop=value> various properties
+ 
+   * <accurevExe> Path to the accuRev executable
+   
+   * <tagFormat> Maps branch/tag/version names to AccuRev stream names and vice-versa. See the "tag" command below.
+   If provided all streams are expected to conform to this naming standard. 
+   
+   The above can also be referenced as system properties - "maven.scm.accurev.<propertyname>"
+ 
  * </project/path> is the relative path of your project within AccuRev. Note that AccuRev has no concept of checking
  out a sub-directory so checkouts always create this physical path under the working directory. 
- 
-  
- NOTE: There is no specification of depot as it is not required by any of the commands.
+   
+ NOTE: There is no specification of depot as it can be derived from the working directory or stream names.
 
 SCM Commands  
 
@@ -59,7 +65,7 @@ SCM Commands  
  The recommended method is to run <<<accurev login>>> externally. For automated SCM operations (e.g. Continuum), 
  suggest using <<<accurev login -n>>> to create a persistent login that won't expire in the middle of your build.
  
- But if you really want to embed this information in URLS and config files, read on.
+ If you really want to embed this information in URLS and config files, read on.
  
  Username and password can either come from the URL, or from a <<< <server> >>> section in a settings.xml file.
  
@@ -91,9 +97,9 @@ SCM Commands  
  the URL then the checkout will be aborted. 
  
  If a workspace exists at the checkout location then it will be reused. If necessary the basisStream of the workspace
- will be reparented (with <<<accurev chws -b>>>). 
+ will be reparented with <<<accurev chws -b>>>. 
  
- If the checkout location is not an existing workspace then a new one is created. (with <<<accurev mkws>>>)
+ If the checkout location is not an existing workspace then a new one is created with <<<accurev mkws>>>
  
  Workspace names are generated by concatenating the basis stream and the base name of the checkout directory unless the
  basis stream contains the base name or vice versa, in which case the longer one is used.
@@ -103,43 +109,25 @@ SCM Commands  
  The final step is to update the workspace to the tranid/timestamp specified in the supplied version (or "highest" if
  not specified). Note that workspaces cannot go backwards, even when reparented or repopulated and you will get
  "transaction out of range" errors if you try.
-
-  * <<TODO>> consider using a property to specify workspace name. (or pattern %s replaced with basisStream+baseName)
- 
-  * <<TODO>> Create workspaces with include rules to only include /project/path. 
- 
-  * <<TODO>> Property switch so reftrees are used instead of workspaces. At first glance reftrees suit the Continuum use
- case. However many a failed build is fixed in the build environment and then promoted. So reftrees are just a workspace
- without that capability. 
   
  * Non persistent checkout
 
  If the persistCheckout flag is false, the provider redirects the checkout to the export command as below.
- 
-  <<TODO>> raise JIRA to propose equivalence of non-persistent checkout and "export"
- Only seems to impact Perforce + AccuRev but all downstream use must "set" a flag on the repository. Would prefer they
- retrieved a flag and then choose whether to call checkout or export.  
-
- <<TODO>> raise JIRA against maven-scm to have the tck tests support this properly
- or change the default of persistCheckout to true.
- 
+  
 * Export
 
  A populate outside of a workspace <<<accurev pop -V -l >>> If the checkout directory exists
  within a subdirectory of a workspace AccuRev would normally generate an error. To work around this restriction
  the existing workspace is temporarily deactivated during the export.
- 
- <<TODO>> raise case with AccuRev to allow an external populate to an ignored sub directory of a workspace.
- 
- <<TODO>> raise JIRA for Export to support a projectPath like checkout does. 
-   
+    
 * Tag
 
   Creates a snapshot <<< accurev mksnap >>> for the basis stream of the workspace specified by the working directory.
-  A system property "accuRevTagPrefix" can be used to specify a fixed prefix for a tag. Required for the tck tests, but
-  also useful for the release plugin.
   
-  <<TODO>> Consider moving this system property into the URL.
+  A system property "maven.scm.accurev.tagFormat" can be used to specify a java.util.Formatter string used to convert
+  from a maven scm tag name to an accurev stream name for the snapshot.
+  
+  Useful for the release plugin in cases where you have a certain stream naming convention enforced by an AccuRev admin trigger.
   
 * Update
 
@@ -185,18 +173,19 @@ SCM Commands  
 
 * Changelog
 
-  List the changes promoted into a stream between timestamps. 
-  
-  <<<accurev hist -s <stream> -t T1-T2>>>
+  List the changes promoted into a stream between times/transaction ids. 
   
-  <<NOTE>> This will not pickup changes promoted into a parent stream
+  <<<accurev hist -s stream -t T1-T2>>>
+    
+  For AccuRev > 4.7.2 also issues  
   
-  <<TODO>> Filter results based on supplied fileSet.
+  <<<diff -v stream -V stream -t T1-T2>>>
+
+  to synthesise a changeset representing files that have changed upstream.
   
-  <<TODO>> Filter results based on URL's project path.
+  If the version specifies a workspace stream the history of the workspace
+  is merged with the above hist/diff performed on the workspace's basis stream          
   
-  <<TODO>> Use diff -v <stream> -V <stream> -t T1-T2 to get files that have changed upstream      
-
 * Diff
   
   <<Not yet implemented>>
@@ -225,9 +214,7 @@ SCM Commands  
   <<<accurev annotate>>> the specified file
   
   file must be in a workspace/reftree
-  
-  <<TODO>> Question why blame uses CommandParameter.FILE instead of just the fileset, also why not blame on a version?
-  
+    
 * Branch
 
   Not implemented.
@@ -238,4 +225,5 @@ SCM Commands  
 Troubleshooting
  
   Generally to get yourself out of trouble you'll need to manipulate AccuRev externally by moving workspaces around
-  bumping versions, reparenting streams.  
+  bumping versions, reparenting or renaming streams.
+  

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/tcktests.apt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/tcktests.apt?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/tcktests.apt (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/tcktests.apt Fri Jul 30 08:14:27 2010
@@ -8,10 +8,9 @@
 
 Junit4 + JMock
 
- I simply couldn't bring myself to go back to Java 1.4, so this provider requires Java 1.5 and generally
- uses Junit4 annotations and <<<assertThat>>> syntax with {{{http://hamcrest.org}Hamcrest}} matchers.
+ This provider requires Java 1.5 and generally uses Junit4 annotations and <<<assertThat>>> syntax with {{{http://hamcrest.org}Hamcrest}} matchers.
  
- The commands are written against an AccuRev interface and tested using JMock.
+ The commands are written against an AccuRev interface and tested using Mockito.
  
  AccuRevCommandLine then implements that interface and has its own tests to check the expected calls to accurev.
  
@@ -19,11 +18,14 @@ Junit4 + JMock
  
  Watch out for issue between Eclipse and Sun compilers where generics can lead to unresolved symbols.
  Mostly this is factored out to the ScmFileMatcher class.
- 
+  
 TCK Tests 
 
  AccuRev creates some challenges for the existing TCK tests.
  
+ * AccuRev requires the client machine to be time synchronised with the server. If this is not the case the tck tests
+   will almost certainly fail.
+ 
  * Logging in. Use *tckUrlPrefix* system property to specify "user/pass@host:port". To run tests using implicit (external) login
    set *tckAllowImpliedLogin*=true instead.
  
@@ -40,12 +42,19 @@ TCK Tests 
  
  * AccuRev has a 127 character limit on the workspace path so you need to make sure the tckBaseDir is not
  too deep in your filesystem.
-
    
  * We attempt to remove the created workspaces in teardown, but there's no guarantee. Depots can only
  be removed with a <<<maintain>>> command while the server is stopped so this is not attempted. Probably
  easiest to use a separate Accurev instance and periodically blow it away completely. 
    
- * TckTagTest uses a fixed tag name "tag-test". The Tag command uses a system property "accuRevTagPrefix"
- to generate a unique tag name. This is set to the depot name to guarantee uniqueness. (TODO - raise JIRA
- to factor that into a protected method) 
\ No newline at end of file
+ * TckTagTest uses a fixed tag name "tag-test" but AccuRev needs unique stream names across the whole
+ server. We use the "tagFormat" property to have stream names prefixed with the depot name
+ 
+Eclipse TCK tests
+
+ * Lookup error for ScmManager
+ Plexus config needs to be available - either the maven-scm-managers-plexus must be on the class path and have generated resources
+ or the maven-scm-managers-plexus jar for the current reference version must be available in the repository
+ 
+ * No such SCMProvider - accurev
+ Need to generate resources so the plexus config is on the classpath
\ No newline at end of file

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/todos.apt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/todos.apt?rev=980673&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/todos.apt (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/todos.apt Fri Jul 30 08:14:27 2010
@@ -0,0 +1,41 @@
+ --------------
+ Maven SCM AccuRev provider - TODOs
+ --------------
+ Grant Gardner
+ --------------
+ June 2010
+ --------------
+ 
+  * Handle replicas
+  
+  * Issue package on checkout - from a special file?
+  
+  * consider using a property to specify workspace name. (or pattern %s replaced with basisStream+baseName)
+ 
+  * Create workspaces with include rules to only include /project/path. 
+ 
+  * Property switch so reftrees are used instead of workspaces. At first glance reftrees suit the Continuum use
+  case. However many a failed build is fixed in the build environment and then promoted. So reftrees are just a workspace
+  without that capability.
+ 
+ 
+  * Raise JIRA to propose equivalence of non-persistent checkout and "export"
+  Only seems to impact Perforce + AccuRev but all downstream use must "set" a flag on the repository. Would prefer they
+  retrieved a flag and then choose whether to call checkout or export.  
+
+  * Raise JIRA against maven-scm to have the tck tests support this properly
+  or change the default of persistCheckout to true.
+  
+  * raise case with AccuRev to allow an external populate to an ignored sub directory of a workspace.
+ 
+  * raise JIRA for Export to support a projectPath like checkout does.
+     
+  * Filter results based on supplied fileSet.
+  
+  * Filter results based on URL's project path.
+  
+  * Question why blame uses CommandParameter.FILE instead of just the fileset, also why not blame on a version?
+  
+   
+  
+ 
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/todos.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/apt/todos.apt
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/site.xml?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/site.xml (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/site/site.xml Fri Jul 30 08:14:27 2010
@@ -25,6 +25,7 @@
 
     <menu name="Overview">
       <item name="Introduction" href="index.html"/>
+      <item name="TCK Tests" href="tcktests.html"/>
     </menu>
 
     <menu ref="reports" inherit="bottom" />

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeFileMatcher.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeFileMatcher.java?rev=980673&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeFileMatcher.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeFileMatcher.java Fri Jul 30 08:14:27 2010
@@ -0,0 +1,62 @@
+package org.apache.maven.scm;
+
+/*
+ * 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 static org.hamcrest.Matchers.any;
+import static org.hamcrest.Matchers.is;
+
+import java.io.File;
+
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+
+public class ChangeFileMatcher extends TypeSafeMatcher<ChangeFile> {
+
+    private String fileName;
+
+    private Matcher<String> versionMatcher;
+
+    public ChangeFileMatcher(String fileName, Matcher<String> versionMatcher) {
+	this.fileName = new File(fileName).getPath();
+	this.versionMatcher = versionMatcher;
+    }
+
+    @Override
+    public boolean matchesSafely(ChangeFile changeFile) {
+	return is(fileName).matches(new File(changeFile.getName()).getPath());
+    }
+
+    public void describeTo(Description desc) {
+	desc.appendText("ChangeFile with name=");
+	desc.appendValue(fileName);
+	desc.appendText(" and version matching ");
+	desc.appendDescriptionOf(versionMatcher);
+
+    }
+
+    public static Matcher<ChangeFile> changeFile(String fileName) {
+	return new ChangeFileMatcher(fileName, any(String.class));
+    }
+
+    public static Matcher<ChangeFile> changeFile(String fileName, Matcher<String> versionMatcher) {
+	return new ChangeFileMatcher(fileName, versionMatcher);
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeFileMatcher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeFileMatcher.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeSetMatcher.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeSetMatcher.java?rev=980673&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeSetMatcher.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeSetMatcher.java Fri Jul 30 08:14:27 2010
@@ -0,0 +1,76 @@
+package org.apache.maven.scm;
+
+/*
+ * 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 static org.apache.maven.scm.ChangeFileMatcher.changeFile;
+import static org.apache.maven.scm.CollectionSizeMatcher.size;
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.any;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.is;
+
+import java.util.List;
+
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+
+public class ChangeSetMatcher
+    extends TypeSafeMatcher<ChangeSet>
+{
+
+    private String comment;
+
+    private Matcher<Iterable<ChangeFile>> changeFilesMatcher;
+
+    @SuppressWarnings( "unchecked" )
+    public ChangeSetMatcher( String comment, String... fileNames )
+    {
+        this.comment = comment;
+
+        Matcher<? extends ChangeFile> elementMatchers[] = new ChangeFileMatcher[fileNames.length];
+        for ( int i = 0; i < elementMatchers.length; i++ )
+        {
+            elementMatchers[i] = changeFile( fileNames[i], any( String.class ) );
+        }
+        this.changeFilesMatcher = allOf( hasItems( elementMatchers ), size( fileNames.length, ChangeFile.class ) );
+    }
+
+    @SuppressWarnings( "unchecked" )
+    @Override
+    public boolean matchesSafely( ChangeSet changeSet )
+    {
+        List<ChangeFile> files = changeSet.getFiles();
+        return is( comment ).matches( changeSet.getComment() ) && changeFilesMatcher.matches( files );
+    }
+
+    public void describeTo( Description desc )
+    {
+        desc.appendText( "ChangeSet with comment=" );
+        desc.appendValue( comment );
+        desc.appendText( " and files matching " );
+        desc.appendDescriptionOf( changeFilesMatcher );
+    }
+
+    public static Matcher<ChangeSet> changeSet( String comment, String... fileNames )
+    {
+        return new ChangeSetMatcher( comment, fileNames );
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeSetMatcher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/ChangeSetMatcher.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/CollectionSizeMatcher.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/CollectionSizeMatcher.java?rev=980673&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/CollectionSizeMatcher.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/CollectionSizeMatcher.java Fri Jul 30 08:14:27 2010
@@ -0,0 +1,59 @@
+package org.apache.maven.scm;
+
+/*
+ * 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 java.util.Collection;
+
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+
+public class CollectionSizeMatcher<T>
+    extends TypeSafeMatcher<Collection<T>>
+{
+
+    private int size;
+
+    public CollectionSizeMatcher( int size )
+    {
+        this.size = size;
+    }
+
+    @Override
+    public boolean matchesSafely( Collection<T> collection )
+    {
+
+        return collection.size() == this.size;
+
+    }
+
+    public void describeTo( Description desc )
+    {
+        desc.appendText( "with size " );
+        desc.appendValue( size );
+
+    }
+
+
+    public static <T> Matcher<Collection<T>> size( int length, Class<T> clazz )
+    {
+        return new CollectionSizeMatcher<T>( length);
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/CollectionSizeMatcher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/CollectionSizeMatcher.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccuRevCapabilityTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccuRevCapabilityTest.java?rev=980673&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccuRevCapabilityTest.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccuRevCapabilityTest.java Fri Jul 30 08:14:27 2010
@@ -0,0 +1,39 @@
+package org.apache.maven.scm.provider.accurev;
+
+/*
+ * 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 static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+public class AccuRevCapabilityTest
+{
+    @Test
+    public void testDiffBetweenStreams()
+        throws Exception
+    {
+        assertThat( AccuRevCapability.DIFF_BETWEEN_STREAMS.isSupported( "4.7.1" ), is( false ) );
+        assertThat( AccuRevCapability.DIFF_BETWEEN_STREAMS.isSupported( "4.7.2" ), is( true ) );
+        assertThat( AccuRevCapability.DIFF_BETWEEN_STREAMS.isSupported( "4.7.2a" ), is( true ) );
+        assertThat( AccuRevCapability.DIFF_BETWEEN_STREAMS.isSupported( "4.7.4" ), is( true ) );
+        assertThat( AccuRevCapability.DIFF_BETWEEN_STREAMS.isSupported( "5.0.1" ), is( true ) );
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccuRevCapabilityTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccuRevCapabilityTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccuRevScmProviderRepositoryTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccuRevScmProviderRepositoryTest.java?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccuRevScmProviderRepositoryTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccuRevScmProviderRepositoryTest.java Fri Jul 30 08:14:27 2010
@@ -47,4 +47,17 @@ public class AccuRevScmProviderRepositor
         info.setTop( "/my/workspace" );
         assertThat( repo.isWorkSpaceRoot( info ), is( false ) );
     }
+
+    @Test
+    public void testTagFormat()
+        throws Exception
+    {
+        AccuRevScmProviderRepository repo = new AccuRevScmProviderRepository();
+
+        repo.setTagFormat( "depot_%s" );
+
+        assertThat( repo.tagToStream( "test-tag" ), is( "depot_test-tag" ) );
+
+        assertThat( repo.streamToTag( "depot_test-tag" ), is( "test-tag" ) );
+    }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccurevScmProviderTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccurevScmProviderTest.java?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccurevScmProviderTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccurevScmProviderTest.java Fri Jul 30 08:14:27 2010
@@ -23,7 +23,6 @@ import static org.apache.maven.scm.provi
 import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertThat;
 
-import org.apache.maven.scm.provider.ScmProviderRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.junit.Test;
 
@@ -48,11 +47,10 @@ public class AccurevScmProviderTest
     {
         AccuRevScmProvider provider = new AccuRevScmProvider();
 
-        AccuRevScmProviderRepository repository = (AccuRevScmProviderRepository) provider
-            .makeProviderScmRepository( url, ':' );
+        AccuRevScmProviderRepository repository =
+            (AccuRevScmProviderRepository) provider.makeProviderScmRepository( url, ':' );
 
-        assertThat( repository,
-                    isRepo( null, null, null, AccuRevScmProviderRepository.DEFAULT_PORT, expStream, expPath ) );
+        assertThat( repository, isRepo( null, null, null, AccuRev.DEFAULT_PORT, expStream, expPath ) );
 
     }
 
@@ -68,8 +66,7 @@ public class AccurevScmProviderTest
         throws Exception
     {
 
-        assertThat( getRepo( "@myHost:aStream:/project/dir" ), isRepo( null, null, "myHost",
-                                                                       AccuRevScmProviderRepository.DEFAULT_PORT,
+        assertThat( getRepo( "@myHost:aStream:/project/dir" ), isRepo( null, null, "myHost", AccuRev.DEFAULT_PORT,
                                                                        "aStream", "project/dir" ) );
         assertThat( getRepo( "@myHost:5051:/project/dir" ), isRepo( null, null, "myHost", 5051, null, "project/dir" ) );
     }
@@ -86,8 +83,7 @@ public class AccurevScmProviderTest
         throws Exception
     {
         assertThat( getRepo( "aUser/theirPassword:/project/dir" ), isRepo( "aUser", "theirPassword", null,
-                                                                           AccuRevScmProviderRepository.DEFAULT_PORT,
-                                                                           null, "project/dir" ) );
+                                                                           AccuRev.DEFAULT_PORT, null, "project/dir" ) );
 
         assertThat( getRepo( "aUser/theirPassword@theHost:5051:aStream:/project/dir" ), isRepo( "aUser",
                                                                                                 "theirPassword",
@@ -100,10 +96,43 @@ public class AccurevScmProviderTest
         assertThat( getRepo( "aUser/" ), isRepo( "aUser", null, null, 5050, null, null ) );
     }
 
-    private static ScmProviderRepository getRepo( String url )
+    @Test
+    public void testProviderWithProperties()
+        throws Exception
+    {
+        AccuRevScmProviderRepository repo =
+            getRepo( "aUser/theirPassword@theHost:5051:aStream:?tagFormat='depot_%s'&accurevExe=/opt/accurev/bin/accurev:/project/dir" );
+
+        assertThat( repo, isRepo( "aUser", "theirPassword", "theHost", 5051, "aStream", "project/dir" ) );
+        assertThat( repo.getAccuRev().getExecutable(), is( "/opt/accurev/bin/accurev" ) );
+        assertThat( repo.getTagFormat(), is( "depot_%s" ) );
+    }
+
+    @Test
+    public void testProviderWithSystemProperties()
+        throws Exception
+    {
+        String tagFormatProperty = AccuRevScmProvider.SYSTEM_PROPERTY_PREFIX + AccuRevScmProvider.TAG_FORMAT_PROPERTY;
+        System.setProperty( tagFormatProperty, "depot_%s" );
+        String exeProperty = AccuRevScmProvider.SYSTEM_PROPERTY_PREFIX + AccuRevScmProvider.ACCUREV_EXECUTABLE_PROPERTY;
+        System.setProperty( exeProperty, "/expect/overide" );
+
+        AccuRevScmProviderRepository repo =
+            getRepo( "aUser/theirPassword@theHost:5051:aStream:?accurevExe=/opt/accurev/bin/accurev:/project/dir" );
+
+        assertThat( repo, isRepo( "aUser", "theirPassword", "theHost", 5051, "aStream", "project/dir" ) );
+        assertThat( repo.getAccuRev().getExecutable(), is( "/opt/accurev/bin/accurev" ) );
+        assertThat( repo.getTagFormat(), is( "depot_%s" ) );
+
+        System.clearProperty( tagFormatProperty );
+        System.clearProperty( exeProperty );
+    }
+
+    private static AccuRevScmProviderRepository getRepo( String url )
         throws ScmRepositoryException
     {
-        ScmProviderRepository repo = new AccuRevScmProvider().makeProviderScmRepository( url, ':' );
+        AccuRevScmProviderRepository repo =
+            (AccuRevScmProviderRepository) new AccuRevScmProvider().makeProviderScmRepository( url, ':' );
         return repo;
     }
 

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/TransactionTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/TransactionTest.java?rev=980673&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/TransactionTest.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/TransactionTest.java Fri Jul 30 08:14:27 2010
@@ -0,0 +1,35 @@
+package org.apache.maven.scm.provider.accurev;
+
+/*
+ * 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 java.util.Date;
+
+import org.junit.Test;
+
+public class TransactionTest
+{
+    @Test
+    public void testToString()
+        throws Exception
+    {
+        Transaction t = new Transaction( 10L, new Date(), "promote", "me" );
+        t.toString();
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/TransactionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/TransactionTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/VersionMatcher.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/VersionMatcher.java?rev=980673&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/VersionMatcher.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/VersionMatcher.java Fri Jul 30 08:14:27 2010
@@ -0,0 +1,64 @@
+package org.apache.maven.scm.provider.accurev;
+
+/*
+ * 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.accurev.Transaction.Version;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+
+public class VersionMatcher
+    extends TypeSafeMatcher<Version>
+{
+
+    private Long elementId;
+
+    private String path;
+
+    private String virtual;
+
+    private String real;
+
+    public VersionMatcher( Long elementId, String path, String virtual, String real )
+    {
+        this.elementId = elementId;
+        this.path = path;
+        this.virtual = virtual;
+        this.real = real;
+    }
+
+    @Override
+    public boolean matchesSafely( Version v )
+    {
+        return elementId.equals( v.getElementId() ) && path.equals( v.getElementName() )
+            && virtual.equals( v.getVirtualSpec() ) && real.equals( v.getRealSpec() );
+    }
+
+    public void describeTo( Description desc )
+    {
+        desc.appendText( "version with id=" + elementId + " virtual=" + virtual + " real=" + real + " path=" + path );
+
+    }
+
+    public static Matcher<? extends Version> version( Long elementId, String path, String virtual, String real )
+    {
+        return new VersionMatcher( elementId, path, virtual, real );
+    }
+}
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/VersionMatcher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/VersionMatcher.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLineTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLineTest.java?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLineTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLineTest.java Fri Jul 30 08:14:27 2010
@@ -21,6 +21,7 @@ package org.apache.maven.scm.provider.ac
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.Matchers.not;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assume.assumeTrue;
 
@@ -35,7 +36,6 @@ import java.util.Collections;
 import java.util.List;
 
 import org.apache.maven.scm.ScmTestCase;
-import org.apache.maven.scm.command.blame.BlameLine;
 import org.apache.maven.scm.log.ScmLogger;
 import org.apache.maven.scm.provider.accurev.AccuRev;
 import org.apache.maven.scm.provider.accurev.AccuRevStat;
@@ -49,7 +49,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
-@RunWith(JUnit4.class)
+@RunWith( JUnit4.class )
 public class AccuRevCommandLineTest
     extends ScmTestCase
 {
@@ -64,6 +64,7 @@ public class AccuRevCommandLineTest
 
         public BufferedReader getStdinReader()
         {
+
             return stdinReader;
         }
 
@@ -77,12 +78,14 @@ public class AccuRevCommandLineTest
         public AccuRevCommandLineTester()
             throws Exception
         {
+
             setLogger( initLog() );
         }
 
         public AccuRevCommandLineTester( String host, int port )
             throws Exception
         {
+
             super( host, port );
             setLogger( initLog() );
         }
@@ -92,6 +95,7 @@ public class AccuRevCommandLineTest
                                           StreamConsumer stderr )
             throws CommandLineException
         {
+
             if ( stdin != null )
             {
                 stdinReader = new BufferedReader( new InputStreamReader( stdin ) );
@@ -122,6 +126,7 @@ public class AccuRevCommandLineTest
 
         public void setResponse( String response )
         {
+
             this.response = response;
 
         }
@@ -133,6 +138,7 @@ public class AccuRevCommandLineTest
     public void setUp()
         throws Exception
     {
+
         super.setUp();
     }
 
@@ -141,6 +147,7 @@ public class AccuRevCommandLineTest
     public void tearDown()
         throws Exception
     {
+
         super.tearDown();
     }
 
@@ -148,6 +155,7 @@ public class AccuRevCommandLineTest
     protected InputStream getCustomConfiguration()
         throws Exception
     {
+
         return AccuRevJUnitUtil.getPlexusConfiguration();
     }
 
@@ -155,9 +163,10 @@ public class AccuRevCommandLineTest
     public void testPromoteAll()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
 
-        assertThat( accuRevCL.promoteAll( new File( "/my/workspace" ), "cmt msg", new ArrayList<File>() ), is( true ) );
+        assertThat( accuRevCL.promoteAll( new File( "/my/workspace" ), "cmt msg" ), not( nullValue() ) );
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( new File( "/my/workspace" ).getCanonicalFile() ) );
         assertThat( lastCL.getArguments(), is( new String[] { "promote", "-p", "-K", "-c", "cmt msg" } ) );
@@ -168,13 +177,13 @@ public class AccuRevCommandLineTest
     public void testPromote()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         List<File> files = new ArrayList<File>();
         File testfile = new File( "my/test/file" );
         files.add( testfile );
 
-        assertThat( accuRevCL.promote( new File( "/my/workspace" ), files, "cmt msg", new ArrayList<File>() ),
-                    is( true ) );
+        assertThat( accuRevCL.promote( new File( "/my/workspace" ), files, "cmt msg" ), not( nullValue() ) );
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( new File( "/my/workspace" ).getCanonicalFile() ) );
         assertThat( lastCL.getArguments(), is( new String[] { "promote", "-K", "-c", "cmt msg", testfile.getPath() } ) );
@@ -185,6 +194,7 @@ public class AccuRevCommandLineTest
     public void testLogin()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         accuRevCL.setResponse( "Password: a124235bacc3ff" );
         accuRevCL.setExecutable( "accurev.exe" );
@@ -221,24 +231,17 @@ public class AccuRevCommandLineTest
     public void testPop()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester( "aHost", 5051 );
         accuRevCL.setExecutable( "accurev.exe" );
         File testfile = new File( "/my/export" );
         File projectDir = new File( "/./project/dir" );
-        accuRevCL.pop( testfile, "stream/12", Collections.singleton( projectDir ), new ArrayList<File>() );
+        accuRevCL.pop( testfile, "stream/12", Collections.singleton( projectDir ) );
 
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getExecutable(), is( "accurev.exe" ) );
-        assertThat( lastCL.getArguments(), is( new String[] {
-            "pop",
-            "-H",
-            "aHost:5051",
-            "-v",
-            "stream/12",
-            "-L",
-            testfile.getAbsolutePath(),
-            "-R",
-            projectDir.getPath() } ) );
+        assertThat( lastCL.getArguments(), is( new String[] { "pop", "-H", "aHost:5051", "-v", "stream/12", "-L",
+            testfile.getAbsolutePath(), "-R", projectDir.getPath() } ) );
 
     }
 
@@ -246,11 +249,12 @@ public class AccuRevCommandLineTest
     public void testPopWorkSpace()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         accuRevCL.setExecutable( "accurev.exe" );
 
         File testFile = new File( "project/dir" );
-        accuRevCL.pop( new File( "/home/workspace" ), Collections.singleton( testFile ), new ArrayList<File>() );
+        accuRevCL.pop( new File( "/home/workspace" ), Collections.singleton( testFile ) );
 
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getExecutable(), is( "accurev.exe" ) );
@@ -263,6 +267,7 @@ public class AccuRevCommandLineTest
     public void testMkws()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         accuRevCL.setExecutable( "accurev2.exe" );
         File workspaceFile = new File( "/my/workspace/location" );
@@ -271,13 +276,7 @@ public class AccuRevCommandLineTest
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getExecutable(), is( "accurev2.exe" ) );
         assertThat( lastCL.getWorkingDirectory(), is( workspaceFile.getCanonicalFile() ) );
-        assertThat( lastCL.getArguments(), is( new String[] {
-            "mkws",
-            "-b",
-            "myStream",
-            "-w",
-            "myWorkSpaceName",
-            "-l",
+        assertThat( lastCL.getArguments(), is( new String[] { "mkws", "-b", "myStream", "-w", "myWorkSpaceName", "-l",
             workspaceFile.getAbsolutePath() } ) );
 
     }
@@ -286,9 +285,10 @@ public class AccuRevCommandLineTest
     public void testUpdate()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         File workspaceFile = new File( "/my/ws/loc" );
-        accuRevCL.update( workspaceFile, "highest", new ArrayList<File>() );
+        accuRevCL.update( workspaceFile, "highest" );
 
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( workspaceFile.getCanonicalFile() ) );
@@ -300,6 +300,7 @@ public class AccuRevCommandLineTest
     public void testInfo()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         accuRevCL.info( new File( "/my/base/dir" ) );
 
@@ -313,6 +314,7 @@ public class AccuRevCommandLineTest
     public void testRemoveWorkspace()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         accuRevCL.rmws( "myWorkspaceName" );
 
@@ -325,6 +327,7 @@ public class AccuRevCommandLineTest
     public void testStatIgnored()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         File testFile = new File( "/my/base/dir" );
         accuRevCL.stat( testFile );
@@ -338,6 +341,7 @@ public class AccuRevCommandLineTest
     public void testReactivate()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         accuRevCL.reactivate( "ArANdomWorkspaceName" );
 
@@ -350,6 +354,7 @@ public class AccuRevCommandLineTest
     public void testReset()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         Commandline cl = accuRevCL.getCommandline();
         String[] shellCmds = cl.getShellCommandline();
@@ -362,54 +367,49 @@ public class AccuRevCommandLineTest
     public void testAdd()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         List<File> files = new ArrayList<File>();
         File testFile = new File( "my/test/file" );
         files.add( testFile );
-        assertThat( accuRevCL.add( new File( "/workspace" ), files, "my commit message", new ArrayList<File>() ),
-                    is( true ) );
+        assertThat( accuRevCL.add( new File( "/workspace" ), files, "my commit message" ), not( nullValue() ) );
 
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( new File( "/workspace" ).getCanonicalFile() ) );
         assertThat( lastCL.getArguments(), is( new String[] { "add", "-c", "my commit message", testFile.getPath() } ) );
 
-        assertThat( accuRevCL.add( new File( "/workspace" ), files, "", new ArrayList<File>() ), is( true ) );
-        assertThat( lastCL.getArguments(), is( new String[] {
-            "add",
-            "-c",
-            AccuRev.DEFAULT_ADD_MESSAGE,
+        assertThat( accuRevCL.add( new File( "/workspace" ), files, "" ), not( nullValue() ) );
+        assertThat( lastCL.getArguments(), is( new String[] { "add", "-c", AccuRev.DEFAULT_ADD_MESSAGE,
             testFile.getPath() } ) );
 
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings( "unchecked" )
     @Test
     public void testRemove()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         List<File> files = new ArrayList<File>();
         File testFile = new File( "my/test/file" );
         files.add( testFile );
         File workspaceFile = new File( "/workspace" );
-        assertThat( accuRevCL.defunct( workspaceFile, files, "my commit message", new ArrayList<File>() ), is( true ) );
+        assertThat( accuRevCL.defunct( workspaceFile, files, "my commit message" ), not( nullValue() ) );
 
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( workspaceFile.getCanonicalFile() ) );
         assertThat( lastCL.getArguments(),
                     is( new String[] { "defunct", "-c", "my commit message", testFile.getPath() } ) );
 
-        assertThat( accuRevCL.defunct( workspaceFile, files, "", new ArrayList<File>() ), is( true ) );
-        assertThat( lastCL.getArguments(), is( new String[] {
-            "defunct",
-            "-c",
-            AccuRev.DEFAULT_REMOVE_MESSAGE,
+        assertThat( accuRevCL.defunct( workspaceFile, files, "" ), not( nullValue() ) );
+        assertThat( lastCL.getArguments(), is( new String[] { "defunct", "-c", AccuRev.DEFAULT_REMOVE_MESSAGE,
             testFile.getPath() } ) );
 
-        assertThat( accuRevCL.defunct( workspaceFile, Collections.EMPTY_LIST, "", new ArrayList<File>() ), is( true ) );
+        assertThat( accuRevCL.defunct( workspaceFile, Collections.EMPTY_LIST, "" ), not( nullValue() ) );
         assertThat( lastCL.getArguments(), is( new String[] { "defunct", "-c", AccuRev.DEFAULT_REMOVE_MESSAGE, "." } ) );
 
-        assertThat( accuRevCL.defunct( workspaceFile, null, "", new ArrayList<File>() ), is( true ) );
+        assertThat( accuRevCL.defunct( workspaceFile, null, "" ), not( nullValue() ) );
         assertThat( lastCL.getArguments(), is( new String[] { "defunct", "-c", AccuRev.DEFAULT_REMOVE_MESSAGE, "." } ) );
 
     }
@@ -418,19 +418,14 @@ public class AccuRevCommandLineTest
     public void testChangeWorkspace()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         accuRevCL.chws( new File( "/my/workspace" ), "the_workspace_name_me", "a-snapshot" );
 
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( new File( "/my/workspace" ).getCanonicalFile() ) );
-        assertThat( lastCL.getArguments(), is( new String[] {
-            "chws",
-            "-s",
-            "the_workspace_name_me",
-            "-b",
-            "a-snapshot",
-            "-l",
-            "." } ) );
+        assertThat( lastCL.getArguments(), is( new String[] { "chws", "-s", "the_workspace_name_me", "-b",
+            "a-snapshot", "-l", "." } ) );
 
     }
 
@@ -438,17 +433,12 @@ public class AccuRevCommandLineTest
     public void testMkSnap()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
         accuRevCL.mksnap( "a-snapshot", "basisStream" );
 
         Commandline lastCL = accuRevCL.getCommandline();
-        assertThat( lastCL.getArguments(), is( new String[] {
-            "mksnap",
-            "-s",
-            "a-snapshot",
-            "-b",
-            "basisStream",
-            "-t",
+        assertThat( lastCL.getArguments(), is( new String[] { "mksnap", "-s", "a-snapshot", "-b", "basisStream", "-t",
             "now" } ) );
 
     }
@@ -457,8 +447,9 @@ public class AccuRevCommandLineTest
     public void testStatTag()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
-        accuRevCL.statTag( "a-snapshot", new ArrayList<File>() );
+        accuRevCL.statTag( "a-snapshot" );
 
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getArguments(), is( new String[] { "stat", "-a", "-ffl", "-s", "a-snapshot" } ) );
@@ -469,16 +460,14 @@ public class AccuRevCommandLineTest
     public void testStatBackingStream()
         throws Exception
     {
+
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
 
         File basedir = new File( "/my/workspace" );
         List<File> elements = new ArrayList<File>( 1 );
         File addedOrModifiedFile = new File( "addedOrModified/file" );
         elements.add( addedOrModifiedFile );
-        List<File> memberElements = new ArrayList<File>();
-        List<File> nonMemberElements = new ArrayList<File>();
-
-        accuRevCL.statBackingStream( basedir, elements, memberElements, nonMemberElements );
+        accuRevCL.statBackingStream( basedir, elements );
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( basedir.getCanonicalFile() ) );
         assertThat( lastCL.getArguments(), is( new String[] { "stat", "-b", "-ffr", addedOrModifiedFile.getPath() } ) );
@@ -494,13 +483,13 @@ public class AccuRevCommandLineTest
         List<File> noFiles = new ArrayList<File>();
 
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
-        accuRevCL.stat( basedir, noFiles, AccuRevStat.KEPT, new ArrayList<File>() );
+        accuRevCL.stat( basedir, noFiles, AccuRevStat.KEPT );
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( basedir.getCanonicalFile() ) );
         assertThat( lastCL.getArguments(), is( new String[] { "stat", "-ffr", "-k", "-R", "." } ) );
 
         noFiles.add( new File( "." ) );
-        accuRevCL.stat( basedir, noFiles, AccuRevStat.DEFUNCT, new ArrayList<File>() );
+        accuRevCL.stat( basedir, noFiles, AccuRevStat.DEFUNCT );
         lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( basedir.getCanonicalFile() ) );
         assertThat( lastCL.getArguments(), is( new String[] { "stat", "-ffr", "-D", "-R", "." } ) );
@@ -519,14 +508,10 @@ public class AccuRevCommandLineTest
         files.add( testFile );
 
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
-        accuRevCL.stat( basedir, files, AccuRevStat.MISSING, new ArrayList<File>() );
+        accuRevCL.stat( basedir, files, AccuRevStat.MISSING );
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( basedir.getCanonicalFile() ) );
-        assertThat( lastCL.getArguments(), is( new String[] {
-            "stat",
-            "-ffr",
-            "-M",
-            testDir.getPath(),
+        assertThat( lastCL.getArguments(), is( new String[] { "stat", "-ffr", "-M", testDir.getPath(),
             testFile.getPath() } ) );
 
     }
@@ -540,11 +525,35 @@ public class AccuRevCommandLineTest
         File file = new File( "src/main/java/foo.java" );
 
         AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
-        accuRevCL.annotate( basedir, file, new ArrayList<BlameLine>() );
+        accuRevCL.annotate( basedir, file );
 
         Commandline lastCL = accuRevCL.getCommandline();
         assertThat( lastCL.getWorkingDirectory(), is( basedir.getCanonicalFile() ) );
         assertThat( lastCL.getArguments(), is( new String[] { "annotate", "-ftud", file.getPath() } ) );
 
     }
+
+    @Test
+    public void testDiff()
+        throws Exception
+    {
+        AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
+
+        accuRevCL.diff( "myStream", "fromSpec", "toSpec" );
+        Commandline lastCL = accuRevCL.getCommandline();
+        assertThat( lastCL.getArguments(), is( new String[] { "diff", "-fx", "-a", "-i", "-v", "myStream", "-V",
+            "myStream", "-t", "fromSpec-toSpec" } ) );
+
+    }
+
+    @Test
+    public void testShowStream()
+        throws Exception
+    {
+        AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
+        accuRevCL.showStream( "mystream" );
+        Commandline lastCL = accuRevCL.getCommandline();
+        assertThat( lastCL.getArguments(), is( new String[] { "show", "-s", "mystream", "-fx", "streams" } ) );
+        ;
+    }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AnnotateConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AnnotateConsumerTest.java?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AnnotateConsumerTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AnnotateConsumerTest.java Fri Jul 30 08:14:27 2010
@@ -20,8 +20,8 @@ package org.apache.maven.scm.provider.ac
  * under the License.
  */
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
 
 import java.util.ArrayList;
 import java.util.List;

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/ClientVersionConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/ClientVersionConsumerTest.java?rev=980673&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/ClientVersionConsumerTest.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/ClientVersionConsumerTest.java Fri Jul 30 08:14:27 2010
@@ -0,0 +1,39 @@
+package org.apache.maven.scm.provider.accurev.cli;
+
+/*
+ * 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 static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+public class ClientVersionConsumerTest
+{
+
+    @Test
+    public void testConsumeVersion()
+        throws Exception
+    {
+        ClientVersionConsumer consumer = new ClientVersionConsumer();
+        AccuRevJUnitUtil.consume( "/accurev.txt", consumer );
+
+        assertThat( consumer.getClientVersion(), is( "4.7.4b" ) );
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/ClientVersionConsumerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/ClientVersionConsumerTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/DiffConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/DiffConsumerTest.java?rev=980673&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/DiffConsumerTest.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/DiffConsumerTest.java Fri Jul 30 08:14:27 2010
@@ -0,0 +1,51 @@
+package org.apache.maven.scm.provider.accurev.cli;
+
+/*
+ * 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 static org.hamcrest.Matchers.hasItem;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.scm.log.DefaultLog;
+import org.apache.maven.scm.provider.accurev.FileDifference;
+import org.junit.Test;
+
+public class DiffConsumerTest
+{
+
+    @Test
+    public void testDiffXML()
+        throws Exception
+    {
+        List<FileDifference> differences = new ArrayList<FileDifference>();
+        XppStreamConsumer consumer = new DiffConsumer( new DefaultLog(), differences );
+        AccuRevJUnitUtil.consume( "/diff-vvt.xml", consumer );
+
+        assertThat( differences.size(), is( 3 ) );
+        assertThat( differences, hasItem( new FileDifference( 8L, "/tcktests/src/main/java/Application.java", "2/3",
+                                                              null, null ) ) );
+        assertThat( differences, hasItem( new FileDifference( 9L, "/tcktests/hello-world.txt", "2/4",
+                                                              "/tcktests/hello.world", "6/1" ) ) );
+
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/DiffConsumerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/DiffConsumerTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/HistoryConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/HistoryConsumerTest.java?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/HistoryConsumerTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/HistoryConsumerTest.java Fri Jul 30 08:14:27 2010
@@ -19,6 +19,7 @@ package org.apache.maven.scm.provider.ac
  * under the License.
  */
 
+import static org.apache.maven.scm.provider.accurev.VersionMatcher.version;
 import static org.hamcrest.Matchers.hasItem;
 import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertThat;
@@ -30,50 +31,11 @@ import java.util.List;
 
 import org.apache.maven.scm.log.DefaultLog;
 import org.apache.maven.scm.provider.accurev.Transaction;
-import org.apache.maven.scm.provider.accurev.Transaction.Version;
-import org.hamcrest.Description;
-import org.hamcrest.Matcher;
-import org.hamcrest.TypeSafeMatcher;
 import org.junit.Test;
 
 public class HistoryConsumerTest
 {
 
-    public class VersionMatcher
-        extends TypeSafeMatcher<Version>
-    {
-
-        private Long elementId;
-
-        private String path;
-
-        private String virtual;
-
-        private String real;
-
-        public VersionMatcher( Long elementId, String path, String virtual, String real )
-        {
-            this.elementId = elementId;
-            this.path = path;
-            this.virtual = virtual;
-            this.real = real;
-        }
-
-        @Override
-        public boolean matchesSafely( Version v )
-        {
-            return elementId.equals( v.getElementId() ) && path.equals( v.getElementName() )
-                && virtual.equals( v.getVirtualSpec() ) && real.equals( v.getRealSpec() );
-        }
-
-        public void describeTo( Description desc )
-        {
-            desc
-                .appendText( "version with id=" + elementId + " virtual=" + virtual + " real=" + real + " path=" + path );
-
-        }
-    }
-
     @Test
     public void testConsumeStreamHistory()
         throws IOException
@@ -98,9 +60,4 @@ public class HistoryConsumerTest
 
     }
 
-    private Matcher<? extends Version> version( Long elementId, String path, String virtual, String real )
-    {
-        return new VersionMatcher( elementId, path, virtual, real );
-    }
-
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/InfoConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/InfoConsumerTest.java?rev=980673&r1=980672&r2=980673&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/InfoConsumerTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/InfoConsumerTest.java Fri Jul 30 08:14:27 2010
@@ -46,6 +46,7 @@ public class InfoConsumerTest
         assertNull( info.getTop() );
         assertNull( info.getWorkSpace() );
         assertThat( info.getUser(), is( "ggardner" ) );
+        assertThat( info.isLoggedIn(), is( true ) );
 
     }
 
@@ -62,14 +63,22 @@ public class InfoConsumerTest
 
     }
 
+    @Test
+    public void testNotLoggedIn()
+        throws Exception
+    {
+        AccuRevInfo info = consume( "/info.notloggedin.txt" );
+        assertThat( info.isLoggedIn(), is( false ) );
+    }
+
     private AccuRevInfo consume( String resource )
         throws IOException
     {
         AccuRevInfo info = new AccuRevInfo( new File( "/my/project/dir" ) );
         StreamConsumer consumer = new InfoConsumer( info );
 
-        BufferedReader reader = new BufferedReader( new InputStreamReader( this.getClass()
-            .getResourceAsStream( resource ) ) );
+        BufferedReader reader =
+            new BufferedReader( new InputStreamReader( this.getClass().getResourceAsStream( resource ) ) );
 
         String line = reader.readLine();
         while ( line != null )