@Test public void shouldFireLifecycleEventsDuringCreate() { buildablePodCube.create(); assertEventFired(BeforeCreate.class, 1); assertEventFired(AfterCreate.class, 1); }
@Override public void create() throws CubeControlException { try { lifecycle.fire(new BeforeCreate(id)); holder = client.build(template); this.state = State.CREATED; lifecycle.fire(new AfterCreate(id)); } catch (Exception e) { this.state = State.CREATE_FAILED; throw CubeControlException.failedCreate(getId(), e); } }
BuildablePodCube extends BaseCube<Void> { @Override public void create() throws CubeControlException { try { lifecycle.fire(new BeforeCreate(id)); holder = client.build(template); this.state = State.CREATED; lifecycle.fire(new AfterCreate(id)); } catch (Exception e) { this.state = State.CREATE_FAILED; throw CubeControlException.failedCreate(getId(), e); } } }
BuildablePodCube extends BaseCube<Void> { @Override public void create() throws CubeControlException { try { lifecycle.fire(new BeforeCreate(id)); holder = client.build(template); this.state = State.CREATED; lifecycle.fire(new AfterCreate(id)); } catch (Exception e) { this.state = State.CREATE_FAILED; throw CubeControlException.failedCreate(getId(), e); } } BuildablePodCube(Pod resource, OpenShiftClient client, CubeOpenShiftConfiguration configuration); }
BuildablePodCube extends BaseCube<Void> { @Override public void create() throws CubeControlException { try { lifecycle.fire(new BeforeCreate(id)); holder = client.build(template); this.state = State.CREATED; lifecycle.fire(new AfterCreate(id)); } catch (Exception e) { this.state = State.CREATE_FAILED; throw CubeControlException.failedCreate(getId(), e); } } BuildablePodCube(Pod resource, OpenShiftClient client, CubeOpenShiftConfiguration configuration); @Override State state(); @Override String getId(); @Override void create(); @Override void start(); @Override void stop(); @Override void destroy(); @Override boolean isRunningOnRemote(); @Override void changeToPreRunning(); @Override Binding bindings(); @Override Binding configuredBindings(); @Override Void configuration(); }
BuildablePodCube extends BaseCube<Void> { @Override public void create() throws CubeControlException { try { lifecycle.fire(new BeforeCreate(id)); holder = client.build(template); this.state = State.CREATED; lifecycle.fire(new AfterCreate(id)); } catch (Exception e) { this.state = State.CREATE_FAILED; throw CubeControlException.failedCreate(getId(), e); } } BuildablePodCube(Pod resource, OpenShiftClient client, CubeOpenShiftConfiguration configuration); @Override State state(); @Override String getId(); @Override void create(); @Override void start(); @Override void stop(); @Override void destroy(); @Override boolean isRunningOnRemote(); @Override void changeToPreRunning(); @Override Binding bindings(); @Override Binding configuredBindings(); @Override Void configuration();  }