Search in sources :

Example 1 with AccuRevScmProvider

use of org.apache.maven.scm.provider.accurev.AccuRevScmProvider in project maven-scm by apache.

the class AccuRevExportCommandTest method testNonPersistentCheckoutUsesExport.

@Test
public void testNonPersistentCheckoutUsesExport() throws // This is same expectations as above, but using checkout method with setPersist = false.
AccuRevException, ScmException {
    // Setup info to return a stream rooted somewhere around here...
    info.setWorkSpace("myStream_me");
    info.setBasis("someStream");
    info.setTop(basedir.getParent());
    when(accurev.info(basedir)).thenReturn(info);
    when(accurev.stat(basedir)).thenReturn(null);
    when(accurev.rmws("myStream_me")).thenReturn(Boolean.TRUE);
    List<File> poppedFiles = Collections.singletonList(new File("exported/file"));
    when(accurev.popExternal(eq(basedir), eq("mySnapShot"), eq("now"), (Collection<File>) argThat(hasItem(new File("/./project/dir"))))).thenReturn(poppedFiles);
    when(accurev.reactivate("myStream_me")).thenReturn(Boolean.TRUE);
    repo.setPersistCheckout(false);
    ScmRepository scmRepo = new ScmRepository("accurev", repo);
    AccuRevScmProvider provider = new AccuRevScmProvider();
    CheckOutScmResult result = provider.checkOut(scmRepo, new ScmFileSet(basedir), new ScmTag("mySnapShot"));
    verify(accurev).rmws("myStream_me");
    verify(accurev).reactivate("myStream_me");
    assertTrue(result.isSuccess());
}
Also used : ScmRepository(org.apache.maven.scm.repository.ScmRepository) ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmTag(org.apache.maven.scm.ScmTag) AccuRevScmProvider(org.apache.maven.scm.provider.accurev.AccuRevScmProvider) CheckOutScmResult(org.apache.maven.scm.command.checkout.CheckOutScmResult) ScmFileMatcher.assertHasScmFile(org.apache.maven.scm.ScmFileMatcher.assertHasScmFile) File(java.io.File) Test(org.junit.Test) AbstractAccuRevCommandTest(org.apache.maven.scm.provider.accurev.command.AbstractAccuRevCommandTest)

Example 2 with AccuRevScmProvider

use of org.apache.maven.scm.provider.accurev.AccuRevScmProvider in project maven-scm by apache.

the class AccuRevTckUtil method getAccuRevCL.

public AccuRevCommandLine getAccuRevCL() throws Exception {
    if (accurevCL == null) {
        AccuRevScmProvider provider = new AccuRevScmProvider();
        provider.addListener(getLogger());
        AccuRevScmProviderRepository repo = (AccuRevScmProviderRepository) provider.makeProviderScmRepository(getScmUrl(), ':');
        getLogger().debug(repo.toString());
        accurevCL = (AccuRevCommandLine) repo.getAccuRev();
        if (!StringUtils.isEmpty(repo.getUser())) {
            accurevCL.login(repo.getUser(), repo.getPassword());
        }
    }
    return accurevCL;
}
Also used : AccuRevScmProvider(org.apache.maven.scm.provider.accurev.AccuRevScmProvider) AccuRevScmProviderRepository(org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository)

Aggregations

AccuRevScmProvider (org.apache.maven.scm.provider.accurev.AccuRevScmProvider)2 File (java.io.File)1 ScmFileMatcher.assertHasScmFile (org.apache.maven.scm.ScmFileMatcher.assertHasScmFile)1 ScmFileSet (org.apache.maven.scm.ScmFileSet)1 ScmTag (org.apache.maven.scm.ScmTag)1 CheckOutScmResult (org.apache.maven.scm.command.checkout.CheckOutScmResult)1 AccuRevScmProviderRepository (org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository)1 AbstractAccuRevCommandTest (org.apache.maven.scm.provider.accurev.command.AbstractAccuRevCommandTest)1 ScmRepository (org.apache.maven.scm.repository.ScmRepository)1 Test (org.junit.Test)1