use of com.navercorp.pinpoint.hbase.schema.domain.SchemaChangeLog in project pinpoint by naver.
the class ChangeSetManagerTest method getExecutedChangeSets_largerSchemaChangeLogs.
@Test
public void getExecutedChangeSets_largerSchemaChangeLogs() {
ChangeSet changeSet = newChangeSet("id1", "value1");
ChangeSetManager changeSetManager = new ChangeSetManager(Arrays.asList(changeSet));
List<SchemaChangeLog> schemaChangeLogs = Arrays.asList(newSchemaChangeLog("id1", "value1", 1), newSchemaChangeLog("id2", "value2", 2));
List<ChangeSet> executedChangeSets = changeSetManager.getExecutedChangeSets(schemaChangeLogs);
assertThat(executedChangeSets, hasSize(1));
assertThat(executedChangeSets, contains(changeSet));
}
use of com.navercorp.pinpoint.hbase.schema.domain.SchemaChangeLog in project pinpoint by naver.
the class ChangeSetManagerTest method filterExecutedChangeSets_invalidCheckSum.
@Test(expected = IllegalArgumentException.class)
public void filterExecutedChangeSets_invalidCheckSum() {
ChangeSet changeSet = newChangeSet("id1", "value1");
List<ChangeSet> changeSets = Arrays.asList(changeSet);
CheckSum invalidCheckSum = CheckSum.compute(CheckSum.getCurrentVersion(), "value2");
List<SchemaChangeLog> schemaChangeLogs = Arrays.asList(newSchemaChangeLog("id1", "value1", invalidCheckSum, 1));
ChangeSetManager changeSetManager = new ChangeSetManager(changeSets);
changeSetManager.filterExecutedChangeSets(schemaChangeLogs);
}
use of com.navercorp.pinpoint.hbase.schema.domain.SchemaChangeLog in project pinpoint by naver.
the class ChangeSetManagerTest method newSchemaChangeLogs.
private List<SchemaChangeLog> newSchemaChangeLogs(ChangeSet... changeSets) {
List<SchemaChangeLog> schemaChangeLogs = new ArrayList<>();
int execOrder = 1;
for (ChangeSet changeSet : changeSets) {
schemaChangeLogs.add(new SchemaChangeLog.Builder().id(changeSet.getId()).value(changeSet.getValue()).checkSum(CheckSum.compute(CheckSum.getCurrentVersion(), changeSet.getValue())).execOrder(execOrder++).build());
}
return schemaChangeLogs;
}
use of com.navercorp.pinpoint.hbase.schema.domain.SchemaChangeLog in project pinpoint by naver.
the class ChangeSetManagerTest method getExecutedChangeSets_invalidCheckSum.
@Test(expected = IllegalArgumentException.class)
public void getExecutedChangeSets_invalidCheckSum() {
ChangeSet changeSet = newChangeSet("id1", "value1");
List<ChangeSet> changeSets = Arrays.asList(changeSet);
CheckSum invalidCheckSum = CheckSum.compute(CheckSum.getCurrentVersion(), "value2");
List<SchemaChangeLog> schemaChangeLogs = Arrays.asList(newSchemaChangeLog("id1", "value1", invalidCheckSum, 1));
ChangeSetManager changeSetManager = new ChangeSetManager(changeSets);
changeSetManager.getExecutedChangeSets(schemaChangeLogs);
}
use of com.navercorp.pinpoint.hbase.schema.domain.SchemaChangeLog in project pinpoint by naver.
the class ChangeSetManagerTest method filterExecutedChangeSets_invalidId.
@Test(expected = IllegalArgumentException.class)
public void filterExecutedChangeSets_invalidId() {
ChangeSet changeSet = newChangeSet("id1", "value1");
List<ChangeSet> changeSets = Arrays.asList(changeSet);
List<SchemaChangeLog> schemaChangeLogs = Arrays.asList(newSchemaChangeLog("id2", "value1", 1));
ChangeSetManager changeSetManager = new ChangeSetManager(changeSets);
changeSetManager.filterExecutedChangeSets(schemaChangeLogs);
}
Aggregations