use of com.structurizr.model.Container in project agile-architecture-documentation-system by Riduidel.
the class SequenceDiagramVisitor method startVisit.
@Override
public boolean startVisit(Container container) {
if (allowSequenceGeneration(container)) {
if (container.getProperties().containsKey(ModelElementKeys.JAVA_SOURCES)) {
ProjectRoot projectRoot = createProjectRootFor(container);
Map<String, CompilationUnit> sources = parseAllSources(projectRoot);
callGraphModel = new CallGraphModel(codeToComponents, sources);
// Now we have all compilation units parsed, let's try to analyze that a little by, say,
// mapping class names to their associated compilation units
callGraphModel.analyzeCalls(getComponentsToScanFor(container).stream().flatMap(component -> component.getCode().stream()).map(code -> code.getType()).collect(Collectors.toList()));
return true;
} else {
logger.log(Level.SEVERE, String.format("Unable to generate sequence diagrams since container %s has no associated sources", StructurizrUtils.getCanonicalPath(container)));
}
}
// In any missing info case, return false
return false;
}
use of com.structurizr.model.Container in project dsl by structurizr.
the class ContainerParserTests method test_parse_CreatesAContainer.
@Test
void test_parse_CreatesAContainer() {
SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "Description");
SoftwareSystemDslContext context = new SoftwareSystemDslContext(softwareSystem);
parser.parse(context, tokens("container", "Name"));
assertEquals(2, model.getElements().size());
Container container = softwareSystem.getContainerWithName("Name");
assertNotNull(container);
assertEquals("", container.getDescription());
assertEquals("", container.getTechnology());
assertEquals("Element,Container", container.getTags());
}
use of com.structurizr.model.Container 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.Container 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.Container 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());
}
Aggregations