Search in sources :

Example 11 with Group

use of org.eclipse.bpmn2.Group in project google-cloud-java by GoogleCloudPlatform.

the class GroupServiceClientTest method getGroupTest.

@Test
@SuppressWarnings("all")
public void getGroupTest() {
    GroupName name2 = GroupName.create("[PROJECT]", "[GROUP]");
    String displayName = "displayName1615086568";
    GroupName parentName = GroupName.create("[PROJECT]", "[GROUP]");
    String filter = "filter-1274492040";
    boolean isCluster = false;
    Group expectedResponse = Group.newBuilder().setNameWithGroupName(name2).setDisplayName(displayName).setParentNameWithGroupName(parentName).setFilter(filter).setIsCluster(isCluster).build();
    mockGroupService.addResponse(expectedResponse);
    GroupName name = GroupName.create("[PROJECT]", "[GROUP]");
    Group actualResponse = client.getGroup(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<GeneratedMessageV3> actualRequests = mockGroupService.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetGroupRequest actualRequest = (GetGroupRequest) actualRequests.get(0);
    Assert.assertEquals(name, actualRequest.getNameAsGroupName());
}
Also used : GroupName(com.google.monitoring.v3.GroupName) Group(com.google.monitoring.v3.Group) GetGroupRequest(com.google.monitoring.v3.GetGroupRequest) GeneratedMessageV3(com.google.protobuf.GeneratedMessageV3) Test(org.junit.Test)

Example 12 with Group

use of org.eclipse.bpmn2.Group in project openstack4j by ContainX.

the class KeystoneGroupServiceTests method group_get_byName_byDomainId_NotExist_Test.

public void group_get_byName_byDomainId_NotExist_Test() throws Exception {
    respondWith(JSON_GROUPS_EMPTY_LIST);
    Group group = osv3().identity().groups().getByName(GROUP_NAME, GROUP_DOMAIN_ID);
    assertNull(group);
}
Also used : Group(org.openstack4j.model.identity.v3.Group)

Example 13 with Group

use of org.eclipse.bpmn2.Group in project openstack4j by ContainX.

the class KeystoneGroupServiceTests method group_crud_test.

// ------------ Group Tests ------------
// The following tests are to verify the update() method of the GroupService
// using HTTP PATCH, which is not supported by betamax.
// Find more tests in KeystoneGroupServiceSpec in core-integration-test
// module.
public void group_crud_test() throws Exception {
    Group group = Builders.group().name(GROUP_NAME).description(GROUP_DESCRIPTION).domainId(GROUP_DOMAIN_ID).build();
    respondWith(JSON_GROUPS_CREATE);
    Group newGroup = osv3().identity().groups().create(group);
    assertEquals(newGroup.getName(), GROUP_NAME);
    assertEquals(newGroup.getDomainId(), GROUP_DOMAIN_ID);
    assertEquals(newGroup.getDescription(), GROUP_DESCRIPTION);
    String GROUP_ID = newGroup.getId();
    respondWith(JSON_GROUPS_GET_BYID);
    Group group_setToUpdate = osv3().identity().groups().get(GROUP_ID);
    respondWith(JSON_GROUPS_UPDATE);
    Group updatedGroup = osv3.identity().groups().update(group_setToUpdate.toBuilder().description(GROUP_DESCRIPTION_UPDATE).build());
    assertEquals(updatedGroup.getId(), GROUP_ID);
    assertEquals(updatedGroup.getName(), GROUP_NAME);
    assertEquals(updatedGroup.getDomainId(), GROUP_DOMAIN_ID);
    assertEquals(updatedGroup.getDescription(), GROUP_DESCRIPTION_UPDATE);
}
Also used : Group(org.openstack4j.model.identity.v3.Group)

Example 14 with Group

use of org.eclipse.bpmn2.Group in project kie-wb-common by kiegroup.

the class Bpmn2JsonMarshaller method marshallGroup.

protected void marshallGroup(Group group, BPMNPlane plane, JsonGenerator generator, float xOffset, float yOffset, String preProcessingData, Definitions def) throws JsonGenerationException, IOException {
    Map<String, Object> properties = new LinkedHashMap<>();
    if (group.getCategoryValueRef() != null && group.getCategoryValueRef().getValue() != null) {
        properties.put("name", StringEscapeUtils.unescapeXml(group.getCategoryValueRef().getValue()));
    }
    putDocumentationProperty(group, properties);
    marshallProperties(properties, generator);
    generator.writeObjectFieldStart("stencil");
    generator.writeObjectField("id", "Group");
    generator.writeEndObject();
    generator.writeArrayFieldStart("childShapes");
    generator.writeEndArray();
    generator.writeArrayFieldStart("outgoing");
    if (findOutgoingAssociation(plane, group) != null) {
        generator.writeStartObject();
        generator.writeObjectField("resourceId", findOutgoingAssociation(plane, group).getId());
        generator.writeEndObject();
    }
    generator.writeEndArray();
    Bounds bounds = ((BPMNShape) findDiagramElement(plane, group)).getBounds();
    generator.writeObjectFieldStart("bounds");
    generator.writeObjectFieldStart("lowerRight");
    generator.writeObjectField("x", bounds.getX() + bounds.getWidth() - xOffset);
    generator.writeObjectField("y", bounds.getY() + bounds.getHeight() - yOffset);
    generator.writeEndObject();
    generator.writeObjectFieldStart("upperLeft");
    generator.writeObjectField("x", bounds.getX() - xOffset);
    generator.writeObjectField("y", bounds.getY() - yOffset);
    generator.writeEndObject();
    generator.writeEndObject();
}
Also used : Bounds(org.eclipse.dd.dc.Bounds) DataObject(org.eclipse.bpmn2.DataObject) BPMNShape(org.eclipse.bpmn2.di.BPMNShape) LinkedHashMap(java.util.LinkedHashMap)

Example 15 with Group

use of org.eclipse.bpmn2.Group in project kie-wb-common by kiegroup.

the class Bpmn2JsonUnmarshaller method createSubProcessDiagram.

private void createSubProcessDiagram(BPMNPlane plane, FlowElement flowElement, BpmnDiFactory factory) {
    SubProcess sp = (SubProcess) flowElement;
    for (FlowElement subProcessFlowElement : sp.getFlowElements()) {
        if (subProcessFlowElement instanceof SubProcess) {
            createBpmnShapeForElement(factory, plane, subProcessFlowElement);
            createSubProcessDiagram(plane, subProcessFlowElement, factory);
        } else if (subProcessFlowElement instanceof FlowNode) {
            createBpmnShapeForElement(factory, plane, subProcessFlowElement);
            if (subProcessFlowElement instanceof BoundaryEvent) {
                createDockersForBoundaryEvent((BoundaryEvent) subProcessFlowElement);
            }
        } else if (subProcessFlowElement instanceof SequenceFlow) {
            createBpmnEdgeForSequenceFlow(factory, plane, (SequenceFlow) subProcessFlowElement);
        }
    }
    if (sp.getArtifacts() != null) {
        List<Association> incompleteAssociations = new ArrayList<Association>();
        for (Artifact artifact : sp.getArtifacts()) {
            // if (artifact instanceof TextAnnotation || artifact instanceof Group) {
            if (artifact instanceof Group) {
                createBpmnShapeForElement(factory, plane, artifact);
            }
            if (artifact instanceof Association) {
                Association association = (Association) artifact;
                if (association.getSourceRef() != null && association.getTargetRef() != null) {
                    createBpmnEdgeForAssociation(factory, plane, association);
                } else {
                    incompleteAssociations.add(association);
                }
            }
        }
        if (!incompleteAssociations.isEmpty()) {
            for (Association incompleteAssociation : incompleteAssociations) {
                sp.getArtifacts().remove(incompleteAssociation);
            }
        }
    }
}
Also used : AdHocSubProcess(org.eclipse.bpmn2.AdHocSubProcess) SubProcess(org.eclipse.bpmn2.SubProcess) Group(org.eclipse.bpmn2.Group) Association(org.eclipse.bpmn2.Association) DataOutputAssociation(org.eclipse.bpmn2.DataOutputAssociation) DataInputAssociation(org.eclipse.bpmn2.DataInputAssociation) BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) FlowElement(org.eclipse.bpmn2.FlowElement) SequenceFlow(org.eclipse.bpmn2.SequenceFlow) ArrayList(java.util.ArrayList) Artifact(org.eclipse.bpmn2.Artifact) FlowNode(org.eclipse.bpmn2.FlowNode)

Aggregations

ArrayList (java.util.ArrayList)9 Group (org.gluu.oxtrust.model.scim2.Group)8 Test (org.junit.Test)8 Group (org.openstack4j.model.identity.v3.Group)8 Group (ucar.nc2.Group)8 GluuGroup (org.gluu.oxtrust.model.GluuGroup)7 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)7 Group (com.google.monitoring.v3.Group)5 EntryPersistenceException (org.gluu.site.ldap.persistence.exception.EntryPersistenceException)5 FlowElement (org.eclipse.bpmn2.FlowElement)4 RootElement (org.eclipse.bpmn2.RootElement)4 GroupName (com.google.monitoring.v3.GroupName)3 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)3 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)3 URI (java.net.URI)3 Date (java.util.Date)3 DefaultValue (javax.ws.rs.DefaultValue)3 HeaderParam (javax.ws.rs.HeaderParam)3 Produces (javax.ws.rs.Produces)3 Response (javax.ws.rs.core.Response)3