private void verifyOnDemandLoadDeleteOnUnknown(URI factoryUri) { for (int i = 0; i < 10; i++) { // do a DELETE for a completely unknown service, expect 200. // The 200 status is to stay consistent with the behavior for // non-ODL services. String unknownServicePath = "unknown-" + this.host.nextUUID(); URI unknownServiceUri = UriUtils.extendUri(factoryUri, unknownServicePath); Operation delete = Operation .createDelete(unknownServiceUri); this.host.sendAndWaitExpectSuccess(delete); ExampleServiceState body = new ExampleServiceState(); // now create the service, expect success body.name = this.host.nextUUID(); body.documentSelfLink = unknownServicePath; Operation post = Operation.createPost(factoryUri) .setBody(body); this.host.sendAndWaitExpectSuccess(post); // delete the "unknown" service delete = Operation .createDelete(unknownServiceUri); this.host.sendAndWaitExpectSuccess(delete); } }
@Test public void startServiceSelfLinkWithStar() throws Throwable { setUp(false); MinimalTestServiceState initialState = new MinimalTestServiceState(); initialState.id = this.host.nextUUID(); TestContext ctx = this.host.testCreate(1); Operation startPost = Operation .createPost(UriUtils.buildUri(this.host, this.host.nextUUID() + "*")) .setBody(initialState).setCompletion(ctx.getExpectedFailureCompletion()); this.host.startService(startPost, new MinimalTestService()); this.host.testWait(ctx); }
@Test public void startServiceSelfLinkWithStar() throws Throwable { setUp(false); MinimalTestServiceState initialState = new MinimalTestServiceState(); initialState.id = this.host.nextUUID(); TestContext ctx = this.host.testCreate(1); Operation startPost = Operation .createPost(UriUtils.buildUri(this.host, this.host.nextUUID() + "*")) .setBody(initialState).setCompletion(ctx.getExpectedFailureCompletion()); this.host.startService(startPost, new MinimalTestService()); this.host.testWait(ctx); }
private void verifyOnDemandLoadDeleteOnUnknown(URI factoryUri) { for (int i = 0; i < 10; i++) { // do a DELETE for a completely unknown service, expect 200. // The 200 status is to stay consistent with the behavior for // non-ODL services. String unknownServicePath = "unknown-" + this.host.nextUUID(); URI unknownServiceUri = UriUtils.extendUri(factoryUri, unknownServicePath); Operation delete = Operation .createDelete(unknownServiceUri); this.host.sendAndWaitExpectSuccess(delete); ExampleServiceState body = new ExampleServiceState(); // now create the service, expect success body.name = this.host.nextUUID(); body.documentSelfLink = unknownServicePath; Operation post = Operation.createPost(factoryUri) .setBody(body); this.host.sendAndWaitExpectSuccess(post); // delete the "unknown" service delete = Operation .createDelete(unknownServiceUri); this.host.sendAndWaitExpectSuccess(delete); } }
for (URI u : states.keySet()) { ExampleServiceState state = new ExampleServiceState(); state.name = this.host.nextUUID(); sender.sendRequest(Operation.createGet(u).setCompletion(ctx.getCompletion())); sender.sendRequest( Operation.createPatch(u) .setContextId(this.host.nextUUID()) .setBody(state).setCompletion(ctx.getCompletion())); for (URI u : states.keySet()) { ExampleServiceState state = new ExampleServiceState(); state.name = this.host.nextUUID(); sender.sendRequest(Operation.createGet(u).setCompletion(ctx.getCompletion())); sender.sendRequest( Operation.createPatch(u).setContextId(this.host.nextUUID()).setBody(state) .setCompletion(ctx.getCompletion()));
for (URI u : states.keySet()) { ExampleServiceState state = new ExampleServiceState(); state.name = this.host.nextUUID(); sender.sendRequest(Operation.createGet(u).setCompletion(ctx.getCompletion())); sender.sendRequest( Operation.createPatch(u) .setContextId(this.host.nextUUID()) .setBody(state).setCompletion(ctx.getCompletion())); for (URI u : states.keySet()) { ExampleServiceState state = new ExampleServiceState(); state.name = this.host.nextUUID(); sender.sendRequest(Operation.createGet(u).setCompletion(ctx.getCompletion())); sender.sendRequest( Operation.createPatch(u).setContextId(this.host.nextUUID()).setBody(state) .setCompletion(ctx.getCompletion()));
body.documentSelfLink = this.host.nextUUID(); body.name = "queue-for-avail-" + UUID.randomUUID().toString(); URI yetToBeCreatedChildUri = UriUtils.extendUri(factoryUri, body.documentSelfLink);
body.documentSelfLink = this.host.nextUUID(); body.name = "queue-for-avail-" + UUID.randomUUID().toString(); URI yetToBeCreatedChildUri = UriUtils.extendUri(factoryUri, body.documentSelfLink);
.buildMinimalTestState(); initialState.documentSelfLink = this.host.nextUUID(); initialStates.put(UriUtils.extendUri(factoryUri, initialState.documentSelfLink), initialState);
.buildMinimalTestState(); initialState.documentSelfLink = this.host.nextUUID(); initialStates.put(UriUtils.extendUri(factoryUri, initialState.documentSelfLink), initialState);