use of org.apache.maven.scm.provider.accurev.WorkSpace in project maven-scm by apache.
the class WorkSpaceConsumer method startTag.
@Override
protected void startTag(List<String> tagPath, Map<String, String> attributes) {
if ("Element".equals(getTagName(tagPath))) {
String name = attributes.get("Name");
long transactionId = Long.valueOf(attributes.get("Trans"));
WorkSpace ws = new WorkSpace(name, transactionId);
workSpaces.put(name, ws);
}
}
use of org.apache.maven.scm.provider.accurev.WorkSpace in project maven-scm by apache.
the class AccurevUpdateCommandTest method testUpdateWithChangeLog.
@Test
public void testUpdateWithChangeLog() throws Exception {
final WorkSpace wsBefore = new WorkSpace("theWorkSpace", 123);
Map<String, WorkSpace> workspaces = Collections.singletonMap("theWorkSpace", wsBefore);
when(accurev.showWorkSpaces()).thenReturn(workspaces);
List<File> emptyList = Collections.emptyList();
when(accurev.update(eq(basedir), any(String.class))).thenReturn(emptyList);
final Date currentDate = new Date();
List<Transaction> transactions = Collections.singletonList(new Transaction(197L, currentDate, "type", "user"));
when(accurev.history(any(String.class), any(String.class), any(String.class), eq(1), eq(true), eq(true))).thenReturn(transactions);
AccuRevUpdateCommand command = new AccuRevUpdateCommand(getLogger());
CommandParameters commandParameters = new CommandParameters();
commandParameters.setString(CommandParameter.RUN_CHANGELOG_WITH_UPDATE, Boolean.toString(true));
UpdateScmResult result = command.update(repo, testFileSet, commandParameters);
assertThat(result.isSuccess(), is(true));
assertThat(result, IsInstanceOf.instanceOf(AccuRevUpdateScmResult.class));
AccuRevUpdateScmResult accuRevResult = (AccuRevUpdateScmResult) result;
assertThat(accuRevResult.getFromRevision(), is("theWorkSpace/123"));
assertThat(accuRevResult.getToRevision(), is("theWorkSpace/197"));
}
use of org.apache.maven.scm.provider.accurev.WorkSpace in project maven-scm by apache.
the class WorkSpaceConsumerTest method testConsumeShowWorkSpaces.
@Test
public void testConsumeShowWorkSpaces() throws IOException {
Map<String, WorkSpace> wsMap = new HashMap<String, WorkSpace>();
XppStreamConsumer consumer = new WorkSpaceConsumer(logger, wsMap);
AccuRevJUnitUtil.consume("/showworkspaces.xml", consumer);
WorkSpace ws = wsMap.get("maventst_ggardner");
assertThat(ws, notNullValue());
assertThat(ws.getTransactionId(), is(49L));
}
use of org.apache.maven.scm.provider.accurev.WorkSpace in project maven-scm by apache.
the class WorkSpaceConsumerTest method testConsumeShowRefTrees.
@Test
public void testConsumeShowRefTrees() throws IOException {
Map<String, WorkSpace> wsMap = new HashMap<String, WorkSpace>();
XppStreamConsumer consumer = new WorkSpaceConsumer(logger, wsMap);
AccuRevJUnitUtil.consume("/showrefs.xml", consumer);
WorkSpace ws = wsMap.get("maven-scm-INT-reftree");
assertThat(ws, notNullValue());
assertThat(ws.getTransactionId(), is(12L));
}
Aggregations