public PreRunningCube(Cube<?> cube) { this(cube.getId()); } }
public NativeAwaitStrategy(Cube<?> cube, DockerClientExecutor dockerClientExecutor) { this.dockerClientExecutor = dockerClientExecutor; this.cubeId = cube.getId(); }
public NativeAwaitStrategy(Cube<?> cube, DockerClientExecutor dockerClientExecutor) { this.dockerClientExecutor = dockerClientExecutor; this.cubeId = cube.getId(); }
public StartCube(Cube<?> cube) { this(cube.getId()); }
public PreRunningCube(Cube<?> cube) { this(cube.getId()); } }
public StartCube(Cube<?> cube) { this(cube.getId()); }
public CreateCube(Cube<?> cube) { this(cube.getId()); }
public StopCube(Cube<?> cube) { this(cube.getId()); }
public DestroyCube(Cube<?> cube) { this(cube.getId()); }
public CreateCube(Cube<?> cube) { this(cube.getId()); }
private boolean isProxyCube(Cube<?> cube, Proxy proxy) { return proxy.getName().equals(cube.getId()); } }
@Override public void addCube(Cube<?> cube) { CubeId cubeId = CubeIdFactory.get().create(cube.getId()); if (cubeId instanceof StarredCubeId) { throw new IllegalArgumentException("Starred cube id cannot be added."); } this.cubes.put(cubeId, cube); }
@Override public void addCube(Cube<?> cube) { CubeId cubeId = CubeIdFactory.get().create(cube.getId()); if (cubeId instanceof StarredCubeId) { throw new IllegalArgumentException("Starred cube id cannot be added."); } this.cubes.put(cubeId, cube); }
private Cube createCubeMock(String cubeId) { Cube cube = Mockito.mock(Cube.class); Mockito.doReturn(cubeId).when(cube).getId(); return cube; }
@Override public boolean call() { try { return client .inspectContainerCmd(cube.getId()) .exec() .getState() .getHealth() .getStatus() .equals("healthy"); } catch (NotFoundException e) { return false; } } }
private void configureCube() throws IOException { cubeRegistry = new LocalCubeRegistry(); when(cube.getId()).thenReturn(CUBE_ID); cubeRegistry.addCube(cube); when(statistics.getNetworks()).thenReturn(getNetworks()); when(statistics.getMemoryStats()).thenReturn(getMemory()); when(statistics.getBlkioStats()).thenReturn(getIOStats()); when(dockerClientExecutor.statsContainer(CUBE_ID)).thenReturn(statistics); }
@Before public void setup() { when(cube.getId()).thenReturn(CUBE_ID); cubeRegistry = new LocalCubeRegistry(); cubeRegistry.addCube(cube); bind(ApplicationScoped.class, CubeRegistry.class, cubeRegistry); }
@Before @SuppressWarnings("unchecked") public void setup() { when(cube.getId()).thenReturn(CUBE_ID); when(container.getName()).thenReturn(CUBE_ID); when(container.getDeployableContainer()).thenReturn(deployableContainer); when(container.getContainerConfiguration()).thenReturn(containerDef); when(containerDef.getContainerProperties()).thenReturn(Collections.EMPTY_MAP); when(containerRegistry.getContainers()).thenReturn(Arrays.asList(container)); registry = new LocalCubeRegistry(); registry.addCube(cube); bind(ApplicationScoped.class, CubeRegistry.class, registry); bind(ApplicationScoped.class, ContainerRegistry.class, containerRegistry); bind(ApplicationScoped.class, CubeConfiguration.class, new CubeConfiguration()); }
@Before public void setup() { when(cube.getId()).thenReturn(CUBE_ID); CubeRegistry registry = new LocalCubeRegistry(); registry.addCube(cube); bind(ApplicationScoped.class, CubeRegistry.class, registry); CubeConfiguration configuration = CubeConfiguration.fromMap(new HashMap<String, String>()); fire(configuration); }
@Test public void shouldExposeAndRegisterCubesFromConfiguration() { bind(ApplicationScoped.class, CubeDockerConfiguration.class, createConfig()); fire(executor); Assert.assertEquals(1, registry.getCubes().size()); Assert.assertEquals("tomcat", registry.getCubes().get(0).getId()); }