本文整理汇总了Java中org.arquillian.cube.CubeController类的典型用法代码示例。如果您正苦于以下问题:Java CubeController类的具体用法?Java CubeController怎么用?Java CubeController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CubeController类属于org.arquillian.cube包,在下文中一共展示了CubeController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stopAndDestroyCubes
import org.arquillian.cube.CubeController; //导入依赖的package包/类
private void stopAndDestroyCubes(ConnectionMode connectionMode, TestClass testClass) {
final CubeController cubeController = cubeControllerInstance.get();
final List<Cube<?>> byMetadata = cubeRegistryInstance.get().getByMetadata(IsContainerObject.class);
byMetadata.stream()
.filter( cube -> {
// To support fork tests
final Class<?> testJavaClass = testClass.getJavaClass();
return testJavaClass.equals(cube.getMetadata(IsContainerObject.class).getTestClass());
})
.filter(cube -> cube.getMetadata(IsContainerObject.class).getConnectionMode() == connectionMode)
.forEach(cube -> {
logger.fine(String.format("Stopping Container Object %s", cube.getId()));
cubeController.stop(cube.getId());
cubeController.destroy(cube.getId());
cubeRegistryInstance.get().removeCube(cube.getId());
});
}
示例2: init
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Before
public void init() {
cubeRegistry = new LocalCubeRegistry();
dockerContainerObjectFactory = new DockerContainerObjectFactory();
cubeController = mock(CubeController.class);
dockerClientExecutor = mock(DockerClientExecutor.class);
injector = mock(Injector.class);
serviceLoader = mock(ServiceLoader.class);
when(serviceLoader.all(any(Class.class))).thenReturn(Collections.emptyList());
dockerContainerObjectFactory.serviceLoaderInstance = () -> serviceLoader;
dockerContainerObjectFactory.dockerClientExecutorInstance = () -> dockerClientExecutor;
dockerContainerObjectFactory.cubeRegistryInstance = () -> cubeRegistry;
dockerContainerObjectFactory.cubeControllerInstance = () -> cubeController;
dockerContainerObjectFactory.injectorInstance = () -> injector;
//We asure that there is no previous executions there.
deleteTestDirectory();
}
示例3: startContainer
import org.arquillian.cube.CubeController; //导入依赖的package包/类
private void startContainer(Container container, Class<?> testClass) {
String containerName = container.getContainerName();
if (isNotInitialized(containerName)) {
DockerCube dockerCube = new DockerCube(containerName, container.getCubeContainer(), dockerClientExecutorInstance.get());
dockerCube.addMetadata(IsContainerObject.class, new IsContainerObject(testClass, container.getConnectionMode()));
logger.finer(String.format("Created Cube with name %s and configuration %s", containerName, dockerCube.configuration()));
cubeRegistryInstance.get().addCube(injectorInstance.get().inject(dockerCube));
CubeController cubeController = cubeControllerInstance.get();
cubeController.create(containerName);
cubeController.start(containerName);
}
}
示例4: init
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Before
public void init() {
cubeRegistry = new LocalCubeRegistry();
networkRegistry = new LocalDockerNetworkRegistry();
cubeController = mock(CubeController.class);
dockerClientExecutor = mock(DockerClientExecutor.class);
}
示例5: initMocks
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Before
public void initMocks() {
cubeController = mock(CubeController.class);
dockerClientExecutor = mock(DockerClientExecutor.class);
cubeRegistry = mock(CubeRegistry.class);
cubeContainerObjectTestEnricher = mock(CubeContainerObjectTestEnricher.class);
doAnswer(DockerContainerObjectBuilderTest::objectContainerEnricherMockEnrich)
.when(cubeContainerObjectTestEnricher).enrich(any());
enrichers = Collections.singleton(cubeContainerObjectTestEnricher);
}
示例6: should_get_running_logs
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Test
public void should_get_running_logs(@ArquillianResource CubeController cubeController,
@ArquillianResource CubeID cubeID) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
cubeController.copyLog(cubeID, false, true, true, false, -1, bos);
String log = new String(bos.toByteArray());
assertThat(log, notNullValue());
}
示例7: should_execute_top
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Ignore
@Test
public void should_execute_top(@ArquillianResource CubeController cubeController, @ArquillianResource CubeID cubeID) {
TopContainer top = cubeController.top(cubeID);
assertThat(top, notNullValue());
assertThat(top.getProcesses(), notNullValue());
assertThat(top.getTitles(), notNullValue());
}
示例8: should_get_changes_on_container
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Test
public void should_get_changes_on_container(@ArquillianResource CubeController cubeController,
@ArquillianResource CubeID cubeID) {
List<ChangeLog> changesOnFilesystem = cubeController.changesOnFilesystem(cubeID);
assertThat(changesOnFilesystem, notNullValue());
assertThat(changesOnFilesystem.size() > 0, is(true));
}
示例9: should_copy_files_from_container
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Test
public void should_copy_files_from_container(@ArquillianResource CubeController cubeController,
@ArquillianResource CubeID cubeID) throws IOException {
File newFolder = folder.newFolder();
cubeController.copyFileDirectoryFromContainer(cubeID, "/usr/local/tomcat/logs", newFolder.getAbsolutePath());
File logFolder = newFolder.listFiles()[0];
assertThat(logFolder, notNullValue());
assertThat(logFolder.listFiles().length > 0, is(true));
}
示例10: should_execute_top
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Test
public void should_execute_top(@ArquillianResource CubeController cubeController, @ArquillianResource CubeID cubeID) {
TopContainer top = cubeController.top(cubeID);
assertThat(top, notNullValue());
assertThat(top.getProcesses(), notNullValue());
assertThat(top.getTitles(), notNullValue());
}
示例11: should_copy_files_from_container
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Test
public void should_copy_files_from_container(@ArquillianResource CubeController cubeController,
@ArquillianResource CubeID cubeID) throws IOException {
File newFolder = folder.newFolder();
cubeController.copyFileDirectoryFromContainer(cubeID, "/tomcat/logs", newFolder.getAbsolutePath());
File logFolder = newFolder.listFiles()[0];
assertThat(logFolder, notNullValue());
assertThat(logFolder.listFiles().length > 0, is(true));
}
示例12: should_execute_top
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Test
public void should_execute_top(@ArquillianResource CubeController cubeController, @ArquillianResource CubeID cubeID) {
TopContainer top = cubeController.top(cubeID);
assertThat(top, notNullValue());
assertThat(top.getProcesses(), notNullValue());
assertThat(top.getTitles(), notNullValue());
assertThat(top.getTitles().length > 0, is(true));
}
示例13: lookup
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Override
public Object lookup(ArquillianResource arg0, Annotation... arg1) {
CubeController cubeController = this.cubeController.get();
if (cubeController == null) {
throw new IllegalStateException("CubeController was not found.");
}
return cubeController;
}
示例14: createAuxiliaryArchive
import org.arquillian.cube.CubeController; //导入依赖的package包/类
@Override
public Archive<?> createAuxiliaryArchive() {
JavaArchive javaArchive = ShrinkWrap.create(JavaArchive.class, "arquillian-cube.jar")
.addPackage(CubeController.class.getPackage())
.addPackages(true, CubeRemoteExtension.class.getPackage())
.addClasses(CubeControllerProvider.class, CubeControlException.class)
.addAsServiceProvider(RemoteLoadableExtension.class, CubeRemoteExtension.class);
if (LoadableExtension.Validate.classExists("org.arquillian.cube.requirement.ArquillianConditionalRunner")) {
javaArchive.addPackages(true, ArquillianConditionalRunner.class.getPackage(), Requires.class.getPackage());
}
return javaArchive;
}
示例15: QPumbaAction
import org.arquillian.cube.CubeController; //导入依赖的package包/类
public QPumbaAction(CubeController cubeController, CubeRegistry cubeRegistry,
CubeDockerConfiguration cubeDockerConfiguration) {
this.cubeController = cubeController;
this.cubeRegistry = cubeRegistry;
this.cubeDockerConfiguration = cubeDockerConfiguration;
}