Package com.cumulocity.me.model.idtype

Examples of com.cumulocity.me.model.idtype.GId


    public BaseRepresentationConverter getConverter() {
        return getManagedObjectConverter();
    }

    protected GId getSampleGId() {
        GId gid = new GId();
        gid.setName("idname");
        gid.setValue(ID);
        return gid;
    }
View Full Code Here


    public void shouldConvertMinimalMoFromJson() throws Exception {
        JSONObject json = minimalJsonManagedObjectRepresentation().build();

        ManagedObjectRepresentation representation = fromJson(json);

        assertThat(representation.getId()).isEqualTo(new GId(ID));
        assertThat(representation.getSelf()).isEqualTo(SELF);
    }
View Full Code Here

    protected GId getGId(JSONObject json) {
        return getGId(json, PROP_ID);
    }
   
    protected GId getGId(JSONObject json, String propertyName) {
        GId id = new GId();
        id.setValue(getString(json, propertyName));
        return id;
    }
View Full Code Here

        boolean atLeastOneItemProcessed = false;
        StringBuffer builder = new StringBuffer();

        Iterator i = ids.iterator();
        while (i.hasNext()) {
            GId gid = (GId) i.next();
            atLeastOneItemProcessed = true;
            builder.append(gid.getValue());
            builder.append(",");
        }

        // remove last comma if needed
        if (atLeastOneItemProcessed) {
View Full Code Here

    OperationCollectionRepresentation allOperations;

    @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

        operation1 = deviceControlResource.create(operationRepresentation);
    }
   
    @Test
    public void shouldCreateRelayOperation() {
        GId deviceId = getMoId(1);
        OperationRepresentation operation = new OperationRepresentation();
        Relay relayControl = new Relay();
        relayControl.setRelayState(RelayState.OPEN);
        operation.set(relayControl);
        operation.setDeviceId(deviceId);
View Full Code Here

        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

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

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

        // When
        Coordinate coordinate = new Coordinate(100.0, 10.0);
        result.set(coordinate);

        GId id = result.getId();
        result.setId(null);
        result.setLastUpdated(null);

        ManagedObjectRepresentation updated = inventory.getManagedObject(id).update(result);
View Full Code Here

        ManagedObjectRepresentation rep = aSampleMo().with(new Coordinate()).build();
        ManagedObjectRepresentation created = inventory.create(rep);

        // When
        created.set(null, Coordinate.class);
        GId id = created.getId();
        created.setId(null);
        created.setLastUpdated(null);
        ManagedObjectRepresentation updated = inventory.getManagedObject(id).update(created);

        // Then
View Full Code Here

TOP

Related Classes of com.cumulocity.me.model.idtype.GId

Copyright © 2018 www.massapicom. 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.