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());
}
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;
}
Aggregations