Author: carlos Date: Thu May 4 20:30:25 2006 New Revision: 399935 URL: http://svn.apache.org/viewcvs?rev=399935&view=rev Log: (empty)
Added: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/ListCommandTckTest.java (with props) Added: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/ListCommandTckTest.java URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/ListCommandTckTest.java?rev=399935&view=auto ============================================================================== --- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/ListCommandTckTest.java (added) +++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/ListCommandTckTest.java Thu May 4 20:30:25 2006 @@ -0,0 +1,80 @@ +package org.apache.maven.scm.tck.command.list; + +/* + * Copyright 2001-2006 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 java.util.List; + +import org.apache.maven.scm.ScmFileSet; +import org.apache.maven.scm.ScmTckTestCase; +import org.apache.maven.scm.command.list.ListScmResult; +import org.apache.maven.scm.provider.ScmProvider; + +/** + * This test tests the list command. + * + * @author <a href="mailto:[EMAIL PROTECTED]">Carlos Sanchez</a> + * @version $Id$ + */ +public abstract class ListCommandTckTest + extends ScmTckTestCase +{ + public void testListCommandTest() + throws Exception + { + ScmFileSet fileSet = new ScmFileSet( new File( "." ), new File( "." ) ); + + List files = runList( fileSet, false ); + + assertEquals( "The result of the list command doesn't have all the files in SCM: " + files, 3, files.size() ); + } + + public void testListCommandRecursiveTest() + throws Exception + { + ScmFileSet fileSet = new ScmFileSet( new File( "." ), new File( "." ) ); + + List files = runList( fileSet, true ); + + assertEquals( "The result of the list command doesn't have all the files in SCM: " + files, 10, files.size() ); + } + + public void testListCommandUnexistantFileTest() + throws Exception + { + ScmFileSet fileSet = new ScmFileSet( new File( "." ), new File( "/void" ) ); + + ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() ); + + ListScmResult result = provider.list( getScmRepository(), fileSet, false, null ); + + assertFalse( "Found file when shouldn't", result.isSuccess() ); + } + + private List runList( ScmFileSet fileSet, boolean recursive ) + throws Exception + { + ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() ); + + ListScmResult result = provider.list( getScmRepository(), fileSet, recursive, null ); + + assertTrue( "Svn command failed: " + result.getCommandLine() + " : " + result.getCommandOutput(), result + .isSuccess() ); + + return result.getFiles(); + } +} Propchange: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/ListCommandTckTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/ListCommandTckTest.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision"