Examples of GId


Examples of com.cumulocity.model.idtype.GId

    }

    @Test
    public void testOperationProcessingSuccessful() throws Exception {
        //GIVEN
        GId id = new GId("op");

        OperationRepresentation op = new OperationRepresentation();
        op.setId(id);
        queue.add(op);
        when(operationProcessor.process(op)).thenReturn(true);
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    }

    @Test
    public void testOperationProcessingFailed() throws Exception {
        //GIVEN
        GId id = new GId("op");
        OperationRepresentation op = new OperationRepresentation();
        op.setId(id);
        queue.add(op);
        when(operationProcessor.process(op)).thenReturn(false);
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    @Test
    public void testStartStop() throws Exception {
        // Given
        OperationRepresentation op = new OperationRepresentation();
        op.setId(new GId("op"));

        // When
        queue.add(op);

        // Then
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

            while (isActive()) {
                try {
                    op = queue.poll(queuePollTimeOut, TimeUnit.MILLISECONDS);
                    if (op != null) {
                        // TODO - refactor. This isn't pretty
                        GId gid = op.getId();
                        Boolean internalOperation = false;
                        if (gid.getValue().startsWith(OperationsQueueHandler.INTERNAL)) {
                            internalOperation = true;
                        }

                        OperationRepresentation executingOperation = null;
                        if (!internalOperation) {
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    OperationCollectionRepresentation allOperations;

    @Given("^I have a poller for agent '([^']*)'$")
    public void iHaveAPollerForAgent(int arg1) throws Exception {
        GId agentId = getMoId(arg1);
        poller = new OperationsByAgentAndStatusPollerImpl(deviceControlResource, agentId.getValue(), OperationStatus.PENDING,
                operationProcessor);
        poller.start();
    }
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

        poller.start();
    }

    @Given("^I have a operation subscriber for agent '([^']*)'$")
    public void iHaveAOperationSubscriberForAgent(int arg1) throws Exception {
        GId agentId = getMoId(arg1);
        subscriber = new OperationNotificationSubscriber(platform);
        subscriber.subscribe(agentId, new SubscriptionListener<GId, OperationRepresentation>() {

            @Override
            public void onNotification(Subscription<GId> subscription, OperationRepresentation notification) {
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

        }
    }

    @When("^I create an operation for device '([^']*)'$")
    public void iCreateAnOperationForDevice(int deviceNum) throws Exception {
        GId deviceId = getMoId(deviceNum);
        OperationRepresentation operationRepresentation = new OperationRepresentation();
        operationRepresentation.setDeviceId(deviceId);
        operationRepresentation.set("smaple_value", "sample_operation_type");
        operation1 = deviceControlResource.create(operationRepresentation);
    }
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

        assertThat(allOperations.getOperations().size(), is(equalTo(amount)));
    }

    @When("^I call get on created operation$")
    public void iCallGetOnCreatedOperation() throws Exception {
        GId operationId = operation1.getId();
        operation1 = deviceControlResource.getOperation(operationId);
    }
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

        OperationFilter filter = new OperationFilter().byAgent(getMoId(agentNum).getValue());
        allOperations = deviceControlResource.getOperationsByFilter(filter).get();
    }

    private GId getMoId(int arg1) {
        GId deviceId = managedObjects.get(arg1).getId();
        return deviceId;
    }
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

        ManagedObjectRepresentation representation = new ManagedObjectRepresentation();
        returnResponseWhenPosting(representation);
        when(parser.parse(response, 201, ManagedObjectRepresentation.class)).thenReturn(null);
        when(response.getLocation()).thenReturn(new URI("http://URI"));
        when(parser.parseIdFromLocation(response)).thenReturn(new GId("mo_id"));

        // When
        ManagedObjectRepresentation result = restConnector.post(PATH, mediaType, representation);

        // Then
        verify(typeBuilder, never()).accept(any(MediaType.class));
        assertThat(result, sameInstance(representation));
        assertThat(result.getId(), is(new GId("mo_id")));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.