use of com.structurizr.Workspace in project java by structurizr.
the class ViewSetTests method test_createDeploymentView_ThrowsAnException_WhenAnEmptyKeyIsSpecified.
@Test
public void test_createDeploymentView_ThrowsAnException_WhenAnEmptyKeyIsSpecified() {
try {
Workspace workspace = new Workspace("Name", "Description");
workspace.getViews().createDeploymentView(" ", "Description");
fail();
} catch (IllegalArgumentException iae) {
assertEquals("A key must be specified.", iae.getMessage());
}
}
use of com.structurizr.Workspace in project java by structurizr.
the class ViewSetTests method test_createDynamicViewForAContainer_ThrowsAnException_WhenANullKeyIsSpecified.
@Test
public void test_createDynamicViewForAContainer_ThrowsAnException_WhenANullKeyIsSpecified() {
try {
Workspace workspace = new Workspace("Name", "Description");
SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
Container container = softwareSystem.addContainer("Container", "Description", "Technology");
workspace.getViews().createDynamicView(container, null, "Description");
fail();
} catch (IllegalArgumentException iae) {
assertEquals("A key must be specified.", iae.getMessage());
}
}
use of com.structurizr.Workspace in project java by structurizr.
the class ViewSetTests method test_copyLayoutInformationFrom_DoesNotDoAnythingIfThereIsNoSystemContextViewToCopyInformationFrom.
@Test
public void test_copyLayoutInformationFrom_DoesNotDoAnythingIfThereIsNoSystemContextViewToCopyInformationFrom() {
Workspace workspace1 = createWorkspace();
Workspace workspace2 = createWorkspace();
SoftwareSystem softwareSystem2 = workspace2.getModel().getSoftwareSystemWithName("Software System");
SystemContextView view2 = workspace2.getViews().createSystemContextView(softwareSystem2, "context", "Description");
view2.addAllElements();
workspace2.getViews().copyLayoutInformationFrom(workspace1.getViews());
// default
assertEquals(0, view2.getElements().iterator().next().getX());
// default
assertNull(view2.getPaperSize());
}
use of com.structurizr.Workspace in project java by structurizr.
the class ViewSetTests method test_createSystemContextView_ThrowsAnException_WhenAnEmptyKeyIsSpecified.
@Test
public void test_createSystemContextView_ThrowsAnException_WhenAnEmptyKeyIsSpecified() {
try {
Workspace workspace = new Workspace("Name", "Description");
SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
workspace.getViews().createSystemContextView(softwareSystem, " ", "Description");
fail();
} catch (IllegalArgumentException iae) {
assertEquals("A key must be specified.", iae.getMessage());
}
}
use of com.structurizr.Workspace in project java by structurizr.
the class ViewSetTests method test_createFilteredView_ThrowsAnException_WhenAnEmptyKeyIsSpecified.
@Test
public void test_createFilteredView_ThrowsAnException_WhenAnEmptyKeyIsSpecified() {
try {
Workspace workspace = new Workspace("Name", "Description");
SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("systemLandscape", "Description");
workspace.getViews().createFilteredView(view, " ", "Description", FilterMode.Include, "tag1", "tag2");
fail();
} catch (IllegalArgumentException iae) {
assertEquals("A key must be specified.", iae.getMessage());
}
}
Aggregations