use of com.structurizr.model.SoftwareSystem in project dsl by structurizr.
the class ContainerParserTests method test_parse_CreatesAContainerWithADescriptionAndTechnology.
@Test
void test_parse_CreatesAContainerWithADescriptionAndTechnology() {
SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "Description");
SoftwareSystemDslContext context = new SoftwareSystemDslContext(softwareSystem);
parser.parse(context, tokens("container", "Name", "Description", "Technology"));
assertEquals(2, model.getElements().size());
Container container = softwareSystem.getContainerWithName("Name");
assertNotNull(container);
assertEquals("Description", container.getDescription());
assertEquals("Technology", container.getTechnology());
assertEquals("Element,Container", container.getTags());
}
use of com.structurizr.model.SoftwareSystem in project dsl by structurizr.
the class ContainerParserTests method test_parse_CreatesAContainerWithADescriptionAndTechnologyAndTags.
@Test
void test_parse_CreatesAContainerWithADescriptionAndTechnologyAndTags() {
SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "Description");
SoftwareSystemDslContext context = new SoftwareSystemDslContext(softwareSystem);
parser.parse(context, tokens("container", "Name", "Description", "Technology", "Tag 1, Tag 2"));
assertEquals(2, model.getElements().size());
Container container = softwareSystem.getContainerWithName("Name");
assertNotNull(container);
assertEquals("Description", container.getDescription());
assertEquals("Technology", container.getTechnology());
assertEquals("Element,Container,Tag 1,Tag 2", container.getTags());
}
use of com.structurizr.model.SoftwareSystem in project dsl by structurizr.
the class ComponentParserTests method test_parse_CreatesAComponentWithADescriptionAndTechnology.
@Test
void test_parse_CreatesAComponentWithADescriptionAndTechnology() {
SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "Description");
Container container = softwareSystem.addContainer("Container", "Description", "Technology");
ContainerDslContext context = new ContainerDslContext(container);
parser.parse(context, tokens("component", "Name", "Description", "Technology"));
assertEquals(3, model.getElements().size());
Component component = container.getComponentWithName("Name");
assertNotNull(component);
assertEquals("Description", component.getDescription());
assertEquals("Technology", component.getTechnology());
assertEquals("Element,Component", component.getTags());
}
use of com.structurizr.model.SoftwareSystem in project dsl by structurizr.
the class ComponentParserTests method test_parse_CreatesAComponentWithADescriptionAndTechnologyAndTags.
@Test
void test_parse_CreatesAComponentWithADescriptionAndTechnologyAndTags() {
SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "Description");
Container container = softwareSystem.addContainer("Container", "Description", "Technology");
ContainerDslContext context = new ContainerDslContext(container);
parser.parse(context, tokens("component", "Name", "Description", "Technology", "Tag 1, Tag 2"));
assertEquals(3, model.getElements().size());
Component component = container.getComponentWithName("Name");
assertNotNull(component);
assertEquals("Description", component.getDescription());
assertEquals("Technology", component.getTechnology());
assertEquals("Element,Component,Tag 1,Tag 2", component.getTags());
}
use of com.structurizr.model.SoftwareSystem in project dsl by structurizr.
the class DynamicViewParserTests method test_parse_CreatesADynamicViewWithSoftwareSystemScope.
@Test
void test_parse_CreatesADynamicViewWithSoftwareSystemScope() {
DslContext context = context();
IdentifiersRegister elements = new IdentifiersRegister();
SoftwareSystem softwareSystem = model.addSoftwareSystem("Name", "Description");
elements.register("softwaresystem", softwareSystem);
context.setIdentifierRegister(elements);
parser.parse(context, tokens("dynamic", "softwareSystem"));
List<DynamicView> views = new ArrayList<>(this.views.getDynamicViews());
assertEquals(1, views.size());
assertEquals("Name-Dynamic-001", views.get(0).getKey());
assertEquals("", views.get(0).getDescription());
assertSame(softwareSystem, views.get(0).getElement());
}
Aggregations