Search in sources :

Example 16 with SoftwareSystem

use of com.structurizr.model.SoftwareSystem in project dsl by structurizr.

the class PropertyParserTests method test_parseProperty_AddsTheProperty_WhenAValueIsSpecified.

@Test
void test_parseProperty_AddsTheProperty_WhenAValueIsSpecified() {
    SoftwareSystem softwareSystem = model.addSoftwareSystem("Name", "Description");
    PropertiesDslContext context = new PropertiesDslContext(softwareSystem);
    new PropertyParser().parse(context, tokens("name", "value"));
    assertEquals("value", softwareSystem.getProperties().get("name"));
}
Also used : SoftwareSystem(com.structurizr.model.SoftwareSystem) Test(org.junit.jupiter.api.Test)

Example 17 with SoftwareSystem

use of com.structurizr.model.SoftwareSystem in project dsl by structurizr.

the class SoftwareSystemParserTests method test_parse_CreatesASoftwareSystem.

@Test
void test_parse_CreatesASoftwareSystem() {
    parser.parse(context(), tokens("softwareSystem", "Name"));
    assertEquals(1, model.getElements().size());
    SoftwareSystem softwareSystem = model.getSoftwareSystemWithName("Name");
    assertNotNull(softwareSystem);
    assertEquals("", softwareSystem.getDescription());
    assertEquals(Location.Unspecified, softwareSystem.getLocation());
    assertEquals("Element,Software System", softwareSystem.getTags());
}
Also used : SoftwareSystem(com.structurizr.model.SoftwareSystem) Test(org.junit.jupiter.api.Test)

Example 18 with SoftwareSystem

use of com.structurizr.model.SoftwareSystem in project dsl by structurizr.

the class SoftwareSystemParserTests method test_parse_CreatesASoftwareSystemWithADescription.

@Test
void test_parse_CreatesASoftwareSystemWithADescription() {
    parser.parse(context(), tokens("softwareSystem", "Name", "Description"));
    assertEquals(1, model.getElements().size());
    SoftwareSystem softwareSystem = model.getSoftwareSystemWithName("Name");
    assertNotNull(softwareSystem);
    assertEquals("Description", softwareSystem.getDescription());
    assertEquals(Location.Unspecified, softwareSystem.getLocation());
    assertEquals("Element,Software System", softwareSystem.getTags());
}
Also used : SoftwareSystem(com.structurizr.model.SoftwareSystem) Test(org.junit.jupiter.api.Test)

Example 19 with SoftwareSystem

use of com.structurizr.model.SoftwareSystem in project dsl by structurizr.

the class SoftwareSystemParserTests method test_parse_CreatesASoftwareSystemWithADescriptionAndTags.

@Test
void test_parse_CreatesASoftwareSystemWithADescriptionAndTags() {
    parser.parse(context(), tokens("softwareSystem", "Name", "Description", "Tag 1, Tag 2"));
    assertEquals(1, model.getElements().size());
    SoftwareSystem softwareSystem = model.getSoftwareSystemWithName("Name");
    assertNotNull(softwareSystem);
    assertEquals("Description", softwareSystem.getDescription());
    assertEquals(Location.Unspecified, softwareSystem.getLocation());
    assertEquals("Element,Software System,Tag 1,Tag 2", softwareSystem.getTags());
}
Also used : SoftwareSystem(com.structurizr.model.SoftwareSystem) Test(org.junit.jupiter.api.Test)

Example 20 with SoftwareSystem

use of com.structurizr.model.SoftwareSystem in project dsl by structurizr.

the class StructurizrDslFormatterTests method test_formattingInternalSoftwareSystemsWhenNoEnterpriseSpecified.

@Test
void test_formattingInternalSoftwareSystemsWhenNoEnterpriseSpecified() throws Exception {
    Workspace workspace = new Workspace("Name", "Description");
    SoftwareSystem ss = workspace.getModel().addSoftwareSystem("Software System");
    ss.setLocation(Location.Internal);
    StructurizrDslFormatter formatter = new StructurizrDslFormatter();
    String result = formatter.format(WorkspaceUtils.toJson(workspace, false));
    assertEquals("workspace \"Name\" \"Description\" {\n" + "\n" + "    !impliedRelationships \"false\" \n" + "    !identifiers \"hierarchical\" \n" + "\n" + "    model {\n" + "        enterprise \"Enterprise\" {\n" + "            SoftwareSystem = softwareSystem \"Software System\" \n" + "        }\n" + "    }\n" + "\n" + "}\n", result);
}
Also used : SoftwareSystem(com.structurizr.model.SoftwareSystem) Workspace(com.structurizr.Workspace) Test(org.junit.jupiter.api.Test)

Aggregations

SoftwareSystem (com.structurizr.model.SoftwareSystem)69 Test (org.junit.jupiter.api.Test)38 Container (com.structurizr.model.Container)23 Workspace (com.structurizr.Workspace)22 Test (org.junit.Test)17 Person (com.structurizr.model.Person)9 Component (com.structurizr.model.Component)8 DynamicView (com.structurizr.view.DynamicView)8 ArrayList (java.util.ArrayList)8 Model (com.structurizr.model.Model)7 DeploymentView (com.structurizr.view.DeploymentView)6 SystemContextView (com.structurizr.view.SystemContextView)6 ViewSet (com.structurizr.view.ViewSet)5 Element (com.structurizr.model.Element)4 Relationship (com.structurizr.model.Relationship)4 ContainerView (com.structurizr.view.ContainerView)4 RelationshipView (com.structurizr.view.RelationshipView)4 DeploymentNode (com.structurizr.model.DeploymentNode)3 ComponentView (com.structurizr.view.ComponentView)3 EncryptedWorkspace (com.structurizr.encryption.EncryptedWorkspace)2