use of com.navercorp.pinpoint.hbase.schema.domain.SchemaChangeLog in project pinpoint by naver.
the class ChangeSetManagerTest method filterExecutedChangeSets_invalidOrder.
@Test(expected = IllegalArgumentException.class)
public void filterExecutedChangeSets_invalidOrder() {
ChangeSet changeSet1 = newChangeSet("id1", "value1");
List<ChangeSet> changeSets = Arrays.asList(changeSet1);
List<SchemaChangeLog> schemaChangeLogs = Arrays.asList(newSchemaChangeLog("id1", "value1", 2));
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 getExecutedChangeSets_invalidOrder.
@Test(expected = IllegalArgumentException.class)
public void getExecutedChangeSets_invalidOrder() {
ChangeSet changeSet1 = newChangeSet("id1", "value1");
List<ChangeSet> changeSets = Arrays.asList(changeSet1);
List<SchemaChangeLog> schemaChangeLogs = Arrays.asList(newSchemaChangeLog("id1", "value1", 2));
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 getExecutedChangeSets_invalidId.
@Test(expected = IllegalArgumentException.class)
public void getExecutedChangeSets_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.getExecutedChangeSets(schemaChangeLogs);
}
use of com.navercorp.pinpoint.hbase.schema.domain.SchemaChangeLog in project pinpoint by naver.
the class ChangeSetManagerTest method filterExecutedChangeSets.
@Test
public void filterExecutedChangeSets() {
ChangeSet changeSet1 = newChangeSet("id1", "value1");
ChangeSet changeSet2 = newChangeSet("id2", "value2");
ChangeSet changeSet3 = newChangeSet("id3", "value3");
ChangeSet changeSet4 = newChangeSet("id4", "value4");
List<ChangeSet> changeSets = Arrays.asList(changeSet1, changeSet2, changeSet3, changeSet4);
List<SchemaChangeLog> schemaChangeLogs = newSchemaChangeLogs(changeSet1);
ChangeSetManager changeSetManager = new ChangeSetManager(changeSets);
List<ChangeSet> filteredChangeSets = changeSetManager.filterExecutedChangeSets(schemaChangeLogs);
assertThat(filteredChangeSets, contains(changeSet2, changeSet3, changeSet4));
}
use of com.navercorp.pinpoint.hbase.schema.domain.SchemaChangeLog in project pinpoint by naver.
the class SchemaChangeLogServiceImplTest method recordChangeSet_withExecutionOrder.
@Test
public void recordChangeSet_withExecutionOrder() {
// Given
final ChangeSet changeSet = newChangeSet("id1");
final int executionOrder = random.nextInt(100) + 1;
doNothing().when(schemaChangeLogDao).insertChangeLog(anyString(), any(SchemaChangeLog.class));
// When
SchemaChangeLog schemaChangeLog = schemaChangeLogService.recordChangeSet("namespace", executionOrder, changeSet);
// Then
MatcherAssert.assertThat(schemaChangeLog.getId(), equalTo(changeSet.getId()));
MatcherAssert.assertThat(schemaChangeLog.getExecOrder(), equalTo(executionOrder));
}
Aggregations