use of io.fabric8.annotations.Path in project fabric8 by jboss-fuse.
the class DummyBatchingProgressMonitor method importFromFileSystem.
@Override
public void importFromFileSystem(String importPath) {
IllegalArgumentAssertion.assertNotNull(importPath, "importPath");
Path importBase = Paths.get(importPath);
importExportHandler.importFromFileSystem(importBase);
importExportHandler.importZipAndArtifacts(importBase.getParent());
LOGGER.info("Profiles imported from " + importPath);
initialVersionsAvailable.countDown();
}
use of io.fabric8.annotations.Path in project fabric8 by jboss-fuse.
the class ZooKeeperGroupTest method testMaster_withStaleNodes1.
@Test
public void testMaster_withStaleNodes1() throws Exception {
// stale
putChildData(group, PATH + "/001", "container1");
putChildData(group, PATH + "/002", "container1");
// stale
putChildData(group, PATH + "/003", "container2");
// stale
putChildData(group, PATH + "/004", "container3");
putChildData(group, PATH + "/005", "container2");
putChildData(group, PATH + "/006", "container3");
NodeState master = group.master();
assertThat(master, notNullValue());
assertThat(master.getContainer(), equalTo("container1"));
}
use of io.fabric8.annotations.Path in project fabric8 by jboss-fuse.
the class ZooKeeperGroupTest method testMaster.
@Test
public void testMaster() throws Exception {
putChildData(group, PATH + "/001", "container1");
putChildData(group, PATH + "/002", "container2");
putChildData(group, PATH + "/003", "container3");
NodeState master = group.master();
assertThat(master, notNullValue());
assertThat(master.getContainer(), equalTo("container1"));
}
use of io.fabric8.annotations.Path in project fabric8 by jboss-fuse.
the class ZooKeeperGroupTest method testMaster_withStaleNodes2.
@Test
public void testMaster_withStaleNodes2() throws Exception {
// stale
putChildData(group, PATH + "/001", "container1");
putChildData(group, PATH + "/002", "container2");
putChildData(group, PATH + "/003", "container1");
// stale
putChildData(group, PATH + "/004", "container3");
putChildData(group, PATH + "/005", "container3");
NodeState master = group.master();
assertThat(master, notNullValue());
assertThat(master.getContainer(), equalTo("container2"));
}
use of io.fabric8.annotations.Path in project fabric8 by jboss-fuse.
the class ZooKeeperGroupTest method putChildData.
private static void putChildData(ZooKeeperGroup<NodeState> group, String path, String container) throws Exception {
NodeState node = new NodeState("test", container);
ByteArrayOutputStream data = new ByteArrayOutputStream();
new ObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).writeValue(data, node);
ChildData<NodeState> child = new ChildData<>(path, new Stat(), data.toByteArray(), node);
group.currentData.put(path, child);
}
Aggregations