package com.perforce.maven.scm.provider.p4.command.branch; /* * Copyright (c) 2010 Perforce Software. All rights reserved. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.tck.command.branch.BranchCommandTckTest; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import com.perforce.maven.scm.provider.p4.P4ScmTestUtils; import com.perforce.maven.scm.provider.p4.util.P4ScmUrl; public class P4BranchLogCommandTckTest extends BranchCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return P4ScmTestUtils.getScmUrl(); } /** {@inheritDoc} */ public void initRepo() throws Exception { P4ScmTestUtils.initRepo(); resetToOrignalFiles(); } protected String getBranch() { try { P4ScmUrl parser = P4ScmUrl.parse( getScmUrl() ); String[] tokens = StringUtils.split( parser.getPath().substring( 1 ), "/" ); StringBuffer buffer = new StringBuffer(); buffer.append( "//" ).append( tokens[0] ).append( "/" ).append( "branches" ); for ( int i = 1; i < tokens.length; ++i ) { buffer.append( "/" ).append( tokens[i] ); } buffer.append( "-" ).append( System.currentTimeMillis() ); return buffer.toString(); } catch ( Exception e ) { throw new IllegalArgumentException( "Unable construction TCK SCM Url", e ); } } private void resetToOrignalFiles() throws Exception { checkOut( getWorkingCopy(), getScmRepository() ); ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), P4ScmTestUtils.getAddedIncludes(), null ); getScmManager().getProviderByUrl( getScmUrl() ).remove( getScmRepository(), fileSet, "Remove previous test files" ); fileSet = new ScmFileSet( getWorkingDirectory() ); getScmManager().getProviderByUrl( getScmUrl() ).edit( getScmRepository(), fileSet ); P4ScmTestUtils.populateOriginalData( getBasedir(), getWorkingCopy() ); checkIn( getWorkingCopy(), getScmRepository() ); FileUtils.deleteDirectory( getWorkingDirectory() ); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 10055 | Matt Attaway | Pull over numerous changes from @dantran's branch. | ||
//guest/dantran/p4maven/p4maven-provider/src/test/java/com/perforce/maven/scm/provider/p4/command/branch/P4BranchLogCommandTckTest.java | |||||
#5 | 9590 | dantran |
- add option to fail tag when it already exist - add P4ScmUrl parser test - cleanup |
||
#4 | 9539 | dantran |
add release automation IT. make test branching random name |
||
#3 | 9528 | dantran | Isolate P2 url parsing task into its own class to be reusable by test | ||
#2 | 9525 | dantran | isolate the location of initial dataset into one place | ||
#1 | 9519 | dantran | folder rename to match with its artifactId | ||
//guest/dantran/p4maven/com.perforce.maven/src/test/java/com/perforce/maven/scm/provider/p4/command/branch/P4BranchLogCommandTckTest.java | |||||
#3 | 9509 | dantran | adjust TCK's new data location which under src/it/template | ||
#2 | 9471 | dantran |
- cleanup diff command - simplify branch command and full compliant with maven-scm-test - add checkout with branch - add repo's path as client manager lookup key in addition to p4port and rootdir so that we can handle mutiple clients on the same rootdir |
||
#1 | 9451 | dantran | Discover current client |