maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dant...@apache.org
Subject svn commit: r476778 - in /maven/scm/trunk/sandbox/maven-scm-provider-starteamtest: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/maven/ src/main/java/org/apache/maven/scm/ src/main/java/org/apach...
Date Sun, 19 Nov 2006 09:21:30 GMT
Author: dantran
Date: Sun Nov 19 01:21:29 2006
New Revision: 476778

URL: http://svn.apache.org/viewvc?view=rev&rev=476778
Log:
initial import of maven-scm-provider-starteamtest

Added:
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/pom.xml
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmTestUtils.java
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/command/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckinCommandTckTest.java
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/test/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/pom.xml
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/readme.txt
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/main/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/main/java/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/main/java/Application.java
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/test/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/test/java/
    maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/test/java/Test.java

Added: maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/pom.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/pom.xml?view=auto&rev=476778
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/pom.xml (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/pom.xml Sun Nov 19 01:21:29 2006
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>maven-scm-providers</artifactId>
+    <groupId>org.apache.maven.scm</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>maven-scm-provider-starteamtest</artifactId>
+  <name>Maven SCM Starteam Provider TCK tests</name>
+  <version>1.0-SNAPSHOT</version>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-test</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-starteam</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>com.borland.starteam</groupId>
+      <artifactId>starteam</artifactId>
+      <version>2005-R2</version>
+     </dependency>
+     <dependency>
+      <groupId>com.borland.starteam</groupId>
+      <artifactId>ss</artifactId>
+       <version>2005-R2</version>
+     </dependency>    
+  </dependencies>
+</project>

Added: maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmTestUtils.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmTestUtils.java?view=auto&rev=476778
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmTestUtils.java
(added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmTestUtils.java
Sun Nov 19 01:21:29 2006
@@ -0,0 +1,106 @@
+package org.apache.maven.scm.provider.starteam;
+
+import java.io.File;
+
+import junit.framework.Assert;
+
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.scm.provider.ScmProvider;
+import org.apache.maven.scm.repository.ScmRepository;
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.codehaus.plexus.util.FileUtils;
+
+import com.starbase.starteam.Folder;
+import com.starbase.starteam.Project;
+import com.starbase.starteam.StarTeamFinder;
+import com.starbase.starteam.StarTeamURL;
+import com.starbase.starteam.View;
+
+public class StarteamScmTestUtils 
+{
+
+	public static String getTestScmUrl()
+	{
+		//TODO look this up using system property
+		return "scm:starteam:Administrator:Administrator@uscus-etc05:49201/replay/junk";
+	}
+
+	public static void initRepo( ScmManager scmManager, String scmUrl, File workingCopy, File
initialImportDirectory )
+	    throws Exception
+	{   		
+        FileUtils.copyDirectoryStructure( initialImportDirectory, workingCopy );
+
+        // now we need to remove all internal .svn
+        DirectoryScanner scanner = new DirectoryScanner();
+        scanner.setBasedir( workingCopy );
+        scanner.setIncludes( DirectoryScanner.DEFAULTEXCLUDES );
+        scanner.scan();
+        String[] dirs = scanner.getIncludedDirectories();
+        for ( int i = 0; i < dirs.length; ++i )
+        {
+            FileUtils.forceDelete( ( new File( workingCopy, dirs[i] ) ) );
+        }
+
+        String starteamUrl = scmUrl.substring( 13 );
+        Project project = StarTeamFinder.openProject( starteamUrl );
+        
+        Assert.assertNotNull( "Unable to find Starteam project in: " + starteamUrl,  project
);  
+        
+        View view = StarTeamFinder.openView( starteamUrl );
+        
+        if ( view != null )
+        {
+            view.remove();
+        }
+
+        View rootView = project.getDefaultView();
+        
+        //StarTeamURL starteamUrl = new StarTeamURL( starteamUrl );
+        
+        String viewName = new StarTeamURL( starteamUrl ).getFolders().nextToken();
+        
+        view = new View( rootView, viewName, "testView", "/tmp/tmp" );
+        
+        view.update();
+        
+            createFolderTree( view.getRootFolder(), workingCopy );
+            importTree( scmManager, scmUrl, view.getRootFolder(), workingCopy );
+                
+	}	
+	
+    /**
+     * create folder tree based on datadir tree
+     * @param folder
+     */
+    private static void createFolderTree( Folder parentFolder,  File dataDir )
+    {
+        DirectoryScanner scanner = new DirectoryScanner();
+        scanner.setBasedir( dataDir );
+        scanner.setExcludes( DirectoryScanner.DEFAULTEXCLUDES );
+        scanner.setIncludes( new String [] {"*"} );
+        scanner.scan();
+        String [] dirs = scanner.getIncludedDirectories();
+        for ( int i = 0; i < dirs.length; ++i )
+        {
+            Folder folder = new Folder( parentFolder, dirs[i], dirs[i] );
+            folder.update();
+            createFolderTree( folder, new File( dataDir, dirs[i] ) );
+        }
+    }	
+    
+    /**
+     * import an directory into starteam
+     * @param folder
+     */
+    private static void importTree( ScmManager scmManager, String scmUrl, Folder parentFolder,
 File dataDir ) throws Exception
+    {
+        ScmFileSet scmFileSet = new ScmFileSet( dataDir, "**", null );
+        
+        ScmRepository mavenScmRepository = scmManager.makeScmRepository( scmUrl );
+        ScmProvider provider = scmManager.getProviderByUrl( scmUrl );
+        
+        provider.add(  mavenScmRepository, scmFileSet );
+        
+    }        
+}

Added: maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckinCommandTckTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckinCommandTckTest.java?view=auto&rev=476778
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckinCommandTckTest.java
(added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckinCommandTckTest.java
Sun Nov 19 01:21:29 2006
@@ -0,0 +1,22 @@
+package org.apache.maven.scm.provider.starteam.command.checkin;
+
+import java.io.File;
+
+import org.apache.maven.scm.provider.starteam.StarteamScmTestUtils;
+import org.apache.maven.scm.tck.command.checkin.CheckInCommandTckTest;
+
+
+public class StarteamCheckinCommandTckTest 
+    extends CheckInCommandTckTest 
+{
+	public String getScmUrl()
+	{
+		return StarteamScmTestUtils.getTestScmUrl();
+	}
+	
+    public void initRepo() throws Exception
+    {
+    	File initialImportDirectory = new File( getBasedir(), "src/test/initial-import" );
+    	StarteamScmTestUtils.initRepo( getScmManager(), getScmUrl(), getWorkingCopy(), initialImportDirectory
);
+    }
+}

Added: maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/pom.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/pom.xml?view=auto&rev=476778
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/pom.xml
(added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/pom.xml
Sun Nov 19 01:21:29 2006
@@ -0,0 +1 @@
+/pom.xml
\ No newline at end of file

Added: maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/readme.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/readme.txt?view=auto&rev=476778
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/readme.txt
(added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/readme.txt
Sun Nov 19 01:21:29 2006
@@ -0,0 +1 @@
+/readme.txt
\ No newline at end of file

Added: maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/main/java/Application.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/main/java/Application.java?view=auto&rev=476778
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/main/java/Application.java
(added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/main/java/Application.java
Sun Nov 19 01:21:29 2006
@@ -0,0 +1 @@
+/src/main/java/Application.java
\ No newline at end of file

Added: maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/test/java/Test.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/test/java/Test.java?view=auto&rev=476778
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/test/java/Test.java
(added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-starteamtest/src/test/initial-import/src/test/java/Test.java
Sun Nov 19 01:21:29 2006
@@ -0,0 +1 @@
+/src/test/java/Test.java
\ No newline at end of file



Mime
View raw message