use of com.structurizr.Workspace in project java by structurizr.
the class ViewSetTests method test_copyLayoutInformationFrom_DoesNotDoAnythingIfThereIsNoSystemLandscapeViewToCopyInformationFrom.
@Test
public void test_copyLayoutInformationFrom_DoesNotDoAnythingIfThereIsNoSystemLandscapeViewToCopyInformationFrom() {
Workspace workspace1 = createWorkspace();
Workspace workspace2 = createWorkspace();
SoftwareSystem softwareSystem2 = workspace2.getModel().getSoftwareSystemWithName("Software System");
SystemLandscapeView view2 = workspace2.getViews().createSystemLandscapeView("landscape", "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_createDeploymentViewForASoftwareSystem_ThrowsAnException_WhenANullKeyIsSpecified.
@Test
public void test_createDeploymentViewForASoftwareSystem_ThrowsAnException_WhenANullKeyIsSpecified() {
try {
Workspace workspace = new Workspace("Name", "Description");
SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
workspace.getViews().createDeploymentView(softwareSystem, 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_createDynamicView_ThrowsAnException_WhenAnEmptyKeyIsSpecified.
@Test
public void test_createDynamicView_ThrowsAnException_WhenAnEmptyKeyIsSpecified() {
try {
Workspace workspace = new Workspace("Name", "Description");
workspace.getViews().createDynamicView(" ", "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_DoesNotDoAnythingIfThereIsNoComponentViewToCopyInformationFrom.
@Test
public void test_copyLayoutInformationFrom_DoesNotDoAnythingIfThereIsNoComponentViewToCopyInformationFrom() {
Workspace workspace1 = createWorkspace();
Workspace workspace2 = createWorkspace();
Container container2 = workspace2.getModel().getSoftwareSystemWithName("Software System").getContainerWithName("Container");
ComponentView view2 = workspace2.getViews().createComponentView(container2, "components", "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_createCustomView_DoesNotThrowAnException_WhenUniqueKeysAreSpecified.
@Test
public void test_createCustomView_DoesNotThrowAnException_WhenUniqueKeysAreSpecified() {
Workspace workspace = new Workspace("Name", "Description");
workspace.getViews().createCustomView("key1", "Title", "Description");
workspace.getViews().createCustomView("key2", "Title", "Description");
}
Aggregations