use of org.pentaho.di.ui.repository.pur.services.IRevisionService in project pentaho-kettle by pentaho.
the class RepositoryTestBase method hasVersionWithComment.
protected boolean hasVersionWithComment(final RepositoryElementInterface element, final String comment) throws Exception {
IRevisionService service = (IRevisionService) repository.getService(IRevisionService.class);
List<ObjectRevision> versions = service.getRevisions(element);
for (ObjectRevision version : versions) {
if (version.getComment().equals(comment)) {
return true;
}
}
return false;
}
use of org.pentaho.di.ui.repository.pur.services.IRevisionService in project pentaho-kettle by pentaho.
the class RepositoryTestBase method testVersions.
@Test
public void testVersions() throws Exception {
IRevisionService service = (IRevisionService) repository.getService(IRevisionService.class);
DatabaseMeta dbMeta = createDatabaseMeta(EXP_DBMETA_NAME);
repository.save(dbMeta, VERSION_COMMENT_V1, null);
deleteStack.push(dbMeta);
List<ObjectRevision> revs = service.getRevisions(dbMeta);
assertTrue(revs.size() >= 1);
dbMeta.setHostname(EXP_DBMETA_HOSTNAME_V2);
repository.save(dbMeta, VERSION_COMMENT_V2, null);
revs = service.getRevisions(dbMeta);
assertTrue(revs.size() >= 2);
// RepositoryVersionRegistry vReg = repository.getVersionRegistry();
// assertEquals(0, vReg.getVersions().size());
// vReg.addVersion(new SimpleObjectVersion(EXP_OBJECT_VERSION_LABEL, null, null, null));
// assertEquals(2, versions.size());
// assertEquals("1.0", versions.get(0).getLabel());
// assertEquals("1.1", versions.get(1).getLabel());
// TODO mlowery finish me
}
use of org.pentaho.di.ui.repository.pur.services.IRevisionService in project pentaho-kettle by pentaho.
the class RepositoryTestBase method hasVersionWithCal.
protected boolean hasVersionWithCal(final RepositoryElementInterface element, final Calendar cal) throws Exception {
IRevisionService service = (IRevisionService) repository.getService(IRevisionService.class);
List<ObjectRevision> versions = service.getRevisions(element);
for (ObjectRevision version : versions) {
if (version.getCreationDate().equals(cal.getTime())) {
return true;
}
}
return false;
}
Aggregations