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 ev...@apache.org on 2005/08/30 18:26:54 UTC
svn commit: r264806 [3/3] - in
/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src:
main/java/org/apache/maven/scm/provider/starteam/command/add/
main/java/org/apache/maven/scm/provider/starteam/command/checkin/
main/java/org/apache/ma...
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java?rev=264806&r1=264805&r2=264806&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java Tue Aug 30 09:26:17 2005
@@ -1,66 +1,66 @@
-package org.apache.maven.scm.provider.starteam.command.status;
-
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed 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.io.File;
-
-import org.apache.maven.scm.ScmTestCase;
-import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
-import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
-import org.apache.maven.scm.repository.ScmRepository;
-
-import org.codehaus.plexus.util.cli.Commandline;
-
-/**
- * @author <a href="mailto:dantran@gmail.com>Dan T. Tran</a>
- * @version
- */
-public class StarteamStatusCommandTest
- extends ScmTestCase
-{
-
- public void testGetCommandLineWithWorkingDirectory()
- throws Exception
- {
- File workDir = new File( "target" );
-
- String workDirAbsolutePath= StarteamCommandLineUtils.toJavaPath( workDir.getAbsolutePath() );
-
- testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl",
- workDir,
- "myTag",
- "stcmd hist -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl " +
- "-fp " + workDirAbsolutePath + " -is" );
- }
-
- // ----------------------------------------------------------------------
- //
- // ----------------------------------------------------------------------
-
- private void testCommandLine( String scmUrl, File workDir, String tag, String commandLine )
- throws Exception
- {
- ScmRepository repo = getScmManager().makeScmRepository( scmUrl );
-
- StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();
-
- Commandline cl = StarteamStatusCommand.createCommandLine( repository, workDir );
-
- assertEquals( commandLine, cl.toString() );
- }
-
- }
+package org.apache.maven.scm.provider.starteam.command.status;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.io.File;
+
+import org.apache.maven.scm.ScmTestCase;
+import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
+import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
+import org.apache.maven.scm.repository.ScmRepository;
+
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * @author <a href="mailto:dantran@gmail.com>Dan T. Tran</a>
+ * @version
+ */
+public class StarteamStatusCommandTest
+ extends ScmTestCase
+{
+
+ public void testGetCommandLineWithWorkingDirectory()
+ throws Exception
+ {
+ File workDir = new File( "target" );
+
+ String workDirAbsolutePath= StarteamCommandLineUtils.toJavaPath( workDir.getAbsolutePath() );
+
+ testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl",
+ workDir,
+ "myTag",
+ "stcmd hist -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl " +
+ "-fp " + workDirAbsolutePath + " -is" );
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private void testCommandLine( String scmUrl, File workDir, String tag, String commandLine )
+ throws Exception
+ {
+ ScmRepository repo = getScmManager().makeScmRepository( scmUrl );
+
+ StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();
+
+ Commandline cl = StarteamStatusCommand.createCommandLine( repository, workDir );
+
+ assertEquals( commandLine, cl.toString() );
+ }
+
+ }
Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusConsumerTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusConsumerTest.java?rev=264806&r1=264805&r2=264806&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusConsumerTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusConsumerTest.java Tue Aug 30 09:26:17 2005
@@ -1,72 +1,72 @@
-package org.apache.maven.scm.provider.starteam.command.status;
-
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed 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 java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
-
-import org.apache.maven.scm.ScmTestCase;
-import org.apache.maven.scm.log.DefaultLog;
-
-/**
- * @author <a href="mailto:dantran@gmail.com">Dan T. Tran</a>
- * @version
- */
-public class StarteamStatusConsumerTest
- extends ScmTestCase
-{
- // must match with the test file
- private static final String WORKING_DIR = "/usr/scm-starteam/driver";
-
- private File testFile;
-
- public void setUp()
- throws Exception
- {
- super.setUp();
-
- testFile = getTestFile( "/src/test/resources/starteam/status/status.txt" );
- }
-
- public void testParse()
- throws Exception
- {
- FileInputStream fis = new FileInputStream( testFile );
-
- BufferedReader in = new BufferedReader( new InputStreamReader( fis ) );
-
- String s = in.readLine();
-
- StarteamStatusConsumer consumer = new StarteamStatusConsumer( new DefaultLog(), new File( WORKING_DIR ) );
-
- while ( s != null )
- {
- consumer.consumeLine( s );
-
- s = in.readLine();
- }
-
- Collection entries = consumer.getChangedFiles();
-
- assertEquals( "Wrong number of entries returned", 4, entries.size() );
-
- // TODO add more validation to the entries
- }
-}
+package org.apache.maven.scm.provider.starteam.command.status;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+import org.apache.maven.scm.ScmTestCase;
+import org.apache.maven.scm.log.DefaultLog;
+
+/**
+ * @author <a href="mailto:dantran@gmail.com">Dan T. Tran</a>
+ * @version
+ */
+public class StarteamStatusConsumerTest
+ extends ScmTestCase
+{
+ // must match with the test file
+ private static final String WORKING_DIR = "/usr/scm-starteam/driver";
+
+ private File testFile;
+
+ public void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+ testFile = getTestFile( "/src/test/resources/starteam/status/status.txt" );
+ }
+
+ public void testParse()
+ throws Exception
+ {
+ FileInputStream fis = new FileInputStream( testFile );
+
+ BufferedReader in = new BufferedReader( new InputStreamReader( fis ) );
+
+ String s = in.readLine();
+
+ StarteamStatusConsumer consumer = new StarteamStatusConsumer( new DefaultLog(), new File( WORKING_DIR ) );
+
+ while ( s != null )
+ {
+ consumer.consumeLine( s );
+
+ s = in.readLine();
+ }
+
+ Collection entries = consumer.getChangedFiles();
+
+ assertEquals( "Wrong number of entries returned", 4, entries.size() );
+
+ // TODO add more validation to the entries
+ }
+}
Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusConsumerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusConsumerTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommandTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommandTest.java?rev=264806&r1=264805&r2=264806&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommandTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommandTest.java Tue Aug 30 09:26:17 2005
@@ -1,63 +1,63 @@
-package org.apache.maven.scm.provider.starteam.command.tag;
-
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed 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.io.File;
-
-import org.apache.maven.scm.ScmTestCase;
-import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
-import org.apache.maven.scm.repository.ScmRepository;
-
-import org.codehaus.plexus.util.cli.Commandline;
-
-/**
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id: StarteamTagCommandTest.java 162289 2005-01-12 15:07:52Z trygvis $
- */
-public class StarteamTagCommandTest
- extends ScmTestCase
-{
- public void testTagCommandLine()
- throws Exception
- {
-
- File workDir = new File( "target" );
-
- testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl",
- workDir,
- "myTag",
- "stcmd label -x -nologo -stop " +
- "-p myusername:mypassword@myhost:1234/projecturl " +
- "-nl myTag -b" );
- }
-
- // ----------------------------------------------------------------------
- //
- // ----------------------------------------------------------------------
-
- private void testCommandLine( String scmUrl, File workDir, String tag, String commandLine )
- throws Exception
- {
- ScmRepository repo = getScmManager().makeScmRepository( scmUrl );
-
- StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();
-
- Commandline cl = StarteamTagCommand.createCommandLine( repository, workDir, tag );
-
- assertEquals( commandLine, cl.toString() );
- }
- }
+package org.apache.maven.scm.provider.starteam.command.tag;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.io.File;
+
+import org.apache.maven.scm.ScmTestCase;
+import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
+import org.apache.maven.scm.repository.ScmRepository;
+
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class StarteamTagCommandTest
+ extends ScmTestCase
+{
+ public void testTagCommandLine()
+ throws Exception
+ {
+
+ File workDir = new File( "target" );
+
+ testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl",
+ workDir,
+ "myTag",
+ "stcmd label -x -nologo -stop " +
+ "-p myusername:mypassword@myhost:1234/projecturl " +
+ "-nl myTag -b" );
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private void testCommandLine( String scmUrl, File workDir, String tag, String commandLine )
+ throws Exception
+ {
+ ScmRepository repo = getScmManager().makeScmRepository( scmUrl );
+
+ StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();
+
+ Commandline cl = StarteamTagCommand.createCommandLine( repository, workDir, tag );
+
+ assertEquals( commandLine, cl.toString() );
+ }
+ }
Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommandTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommandTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.java?rev=264806&r1=264805&r2=264806&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.java Tue Aug 30 09:26:17 2005
@@ -1,106 +1,106 @@
-package org.apache.maven.scm.provider.starteam.command.update;
-
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed 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.io.File;
-
-import org.apache.maven.scm.ScmTestCase;
-
-import org.apache.maven.scm.ScmFileSet;
-
-import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
-import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
-import org.apache.maven.scm.repository.ScmRepository;
-
-import org.codehaus.plexus.util.cli.Commandline;
-
-/**
- * @author <a href="mailto:dantran@gmail.com">Dan T. Tran</a>
- * @version
- */
-public class StarteamUpdateCommandTest
- extends ScmTestCase
-{
- public void testGetCommandLineWithWorkingDirectory()
- throws Exception
- {
- File workDir = new File ( "target" ) ;
-
- String absolutePath=StarteamCommandLineUtils.toJavaPath( workDir.getAbsolutePath() );
-
- testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl",
- workDir,
- "myTag",
- "stcmd co -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl " +
- "-fp " + absolutePath + " -merge -neverprompt -vl myTag -is" );
-
- }
-
-
- public void testGetCommandLineWithFileOnRoot()
- throws Exception
- {
- ScmFileSet fileSet = new ScmFileSet( new File( "./" ), "*", null );
-
- File [] files = fileSet.getFiles();
-
- File workDir = new File( getBasedir() );
-
- String absolutePath= StarteamCommandLineUtils.toJavaPath( workDir.getAbsolutePath() );
-
- testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl",
- files[0],
- "myTag",
- "stcmd co -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl " +
- "-fp " + absolutePath + " -merge -neverprompt -vl myTag " + files[0].getName() );
-
- }
-
- public void testGetCommandLineWithFileInSubDir()
- throws Exception
- {
- ScmFileSet fileSet = new ScmFileSet( new File( "./" ), "**/*.java", null );
-
- File [] files = fileSet.getFiles();
-
- File testFile = files[0];
-
- String absolutePath = StarteamCommandLineUtils.toJavaPath( testFile.getAbsoluteFile().getParent() );
-
- testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl",
- testFile,
- "myTag",
- "stcmd co -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl/" + StarteamCommandLineUtils.toJavaPath( testFile.getParent() ) +
- " -fp " + absolutePath + " -merge -neverprompt -vl myTag " + testFile.getName() );
- }
-
- // ----------------------------------------------------------------------
- //
- // ----------------------------------------------------------------------
-
- private void testCommandLine( String scmUrl, File testFileOrDir, String tag, String commandLine )
- throws Exception
- {
- ScmRepository repo = getScmManager().makeScmRepository( scmUrl );
-
- StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();
-
- Commandline cl = StarteamUpdateCommand.createCommandLine( repository, testFileOrDir, tag );
-
- assertEquals( commandLine, cl.toString() );
- }
- }
+package org.apache.maven.scm.provider.starteam.command.update;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.io.File;
+
+import org.apache.maven.scm.ScmTestCase;
+
+import org.apache.maven.scm.ScmFileSet;
+
+import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
+import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
+import org.apache.maven.scm.repository.ScmRepository;
+
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * @author <a href="mailto:dantran@gmail.com">Dan T. Tran</a>
+ * @version
+ */
+public class StarteamUpdateCommandTest
+ extends ScmTestCase
+{
+ public void testGetCommandLineWithWorkingDirectory()
+ throws Exception
+ {
+ File workDir = new File ( "target" ) ;
+
+ String absolutePath=StarteamCommandLineUtils.toJavaPath( workDir.getAbsolutePath() );
+
+ testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl",
+ workDir,
+ "myTag",
+ "stcmd co -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl " +
+ "-fp " + absolutePath + " -merge -neverprompt -vl myTag -is" );
+
+ }
+
+
+ public void testGetCommandLineWithFileOnRoot()
+ throws Exception
+ {
+ ScmFileSet fileSet = new ScmFileSet( new File( "./" ), "*", null );
+
+ File [] files = fileSet.getFiles();
+
+ File workDir = new File( getBasedir() );
+
+ String absolutePath= StarteamCommandLineUtils.toJavaPath( workDir.getAbsolutePath() );
+
+ testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl",
+ files[0],
+ "myTag",
+ "stcmd co -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl " +
+ "-fp " + absolutePath + " -merge -neverprompt -vl myTag " + files[0].getName() );
+
+ }
+
+ public void testGetCommandLineWithFileInSubDir()
+ throws Exception
+ {
+ ScmFileSet fileSet = new ScmFileSet( new File( "./" ), "**/*.java", null );
+
+ File [] files = fileSet.getFiles();
+
+ File testFile = files[0];
+
+ String absolutePath = StarteamCommandLineUtils.toJavaPath( testFile.getAbsoluteFile().getParent() );
+
+ testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl",
+ testFile,
+ "myTag",
+ "stcmd co -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl/" + StarteamCommandLineUtils.toJavaPath( testFile.getParent() ) +
+ " -fp " + absolutePath + " -merge -neverprompt -vl myTag " + testFile.getName() );
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private void testCommandLine( String scmUrl, File testFileOrDir, String tag, String commandLine )
+ throws Exception
+ {
+ ScmRepository repo = getScmManager().makeScmRepository( scmUrl );
+
+ StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();
+
+ Commandline cl = StarteamUpdateCommand.createCommandLine( repository, testFileOrDir, tag );
+
+ assertEquals( commandLine, cl.toString() );
+ }
+ }
Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision