当前位置: 首页>>代码示例>>Java>>正文


Java CubeController类代码示例

本文整理汇总了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());
            });
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:18,代码来源:AfterClassContainerObjectObserver.java

示例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();
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:20,代码来源:CubeContainerObjectTestEnricherTest.java

示例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);
    }
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:14,代码来源:ContainerNetworkObjectDslTestEnricher.java

示例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);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:8,代码来源:ContainerNetworkObjectDslTestEnricherTest.java

示例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);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:11,代码来源:DockerContainerObjectBuilderTest.java

示例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());
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:9,代码来源:HelloWorldServletIT.java

示例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());
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:9,代码来源:HelloWorldServletIT.java

示例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));
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:8,代码来源:HelloWorldServletIT.java

示例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));
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:10,代码来源:HelloWorldServletIT.java

示例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());
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:8,代码来源:HelloWorldServletIT.java

示例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));
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:10,代码来源:HelloWorldServletIT.java

示例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));
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:9,代码来源:CubeControllerIT.java

示例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;
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:11,代码来源:CubeControllerProvider.java

示例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;
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:15,代码来源:CubeAuxiliaryArchiveAppender.java

示例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;
}
 
开发者ID:arquillian,项目名称:arquillian-cube-q,代码行数:7,代码来源:QPumbaAction.java


注:本文中的org.arquillian.cube.CubeController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。