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"));
}
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());
}
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());
}
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());
}
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);
}
Aggregations