Tabnine Logo
ViewSet.createSystemContextView
Code IndexAdd Tabnine to your IDE (free)

How to use
createSystemContextView
method
in
com.structurizr.view.ViewSet

Best Java code snippets using com.structurizr.view.ViewSet.createSystemContextView (Showing top 20 results out of 315)

origin: structurizr/java

@Test
public void test_createSystemContextView_ThrowsAnException_WhenADuplicateKeyIsSpecified() {
  try {
    Workspace workspace = new Workspace("Name", "Description");
    SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
    workspace.getViews().createSystemContextView(softwareSystem, "key", "Description");
    workspace.getViews().createSystemContextView(softwareSystem, "key", "Description");
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("A view with the key key already exists.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_createSystemContextView_ThrowsAnException_WhenASoftwareSystemIsSpecified() {
  try {
    new Workspace("", "").getViews().createSystemContextView(null, null, "Description");
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("A software system must be specified.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_writeView_SpaceInKey() throws Exception {
  workspace = new Workspace("", "");
  SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("My software system", "");
  Person user = workspace.getModel().addPerson("A user", "");
  user.uses(softwareSystem, "Uses");
  workspace.getViews().createSystemContextView(softwareSystem, "the key", "").addAllElements(); // Space in key
  plantUMLWriter.clearSkinParams();
  plantUMLWriter.write(workspace, stringWriter);
  assertEquals("@startuml(id=the_key)" + System.lineSeparator() + // Quotes added
    "scale max 1999x1999" + System.lineSeparator() +
    "title My software system - System Context" + System.lineSeparator() +
    "" + System.lineSeparator() +
    "rectangle \"A user\" <<Person>> as 2 #dddddd" + System.lineSeparator() +
    "rectangle \"My software system\" <<Software System>> as 1 #dddddd" + System.lineSeparator() +
    "2 .[#707070].> 1 : Uses" + System.lineSeparator() +
    "@enduml" + System.lineSeparator(), stringWriter.toString());
}
origin: structurizr/java

@Test
public void test_addPersonWithoutRelationships_DoesNotAddRelationships() {
  Person user = model.addPerson("User", "");
  SoftwareSystem softwareSystem = model.addSoftwareSystem("Software system 2", "");
  user.uses(softwareSystem, "uses");
  view = views.createSystemContextView(softwareSystem, "key", "description");
  view.add(user, false);
  assertEquals(2, view.getElements().size());
  assertEquals(0, view.getRelationships().size());
}
origin: structurizr/java

@Test
public void test_addSoftwareSystemWithoutRelationships_DoesNotAddRelationships() {
  SoftwareSystem softwareSystem1 = model.addSoftwareSystem("Software system 1", "");
  SoftwareSystem softwareSystem2 = model.addSoftwareSystem("Software system 2", "");
  softwareSystem1.uses(softwareSystem2, "uses");
  view = views.createSystemContextView(softwareSystem1, "key", "description");
  view.add(softwareSystem2, false);
  assertEquals(2, view.getElements().size());
  assertEquals(0, view.getRelationships().size());
}
origin: structurizr/java

@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());
  }
}
origin: structurizr/java

@Test
public void test_createSystemContextView_ThrowsAnException_WhenANullKeyIsSpecified() {
  try {
    Workspace workspace = new Workspace("Name", "Description");
    SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
    workspace.getViews().createSystemContextView(softwareSystem, null, "Description");
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("A key must be specified.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_removePerson_RemovesThePersonAndRelationshipsFromTheView() {
  Person person = model.addPerson("Person", "");
  person.uses(softwareSystem, "uses");
  softwareSystem.delivers(person, "delivers something to");
  view = views.createSystemContextView(softwareSystem, "key", "description");
  view.add(person);
  assertEquals(2, view.getElements().size());
  assertEquals(2, view.getRelationships().size());
  view.remove(person);
  assertEquals(1, view.getElements().size());
  assertEquals(0, view.getRelationships().size());
}
origin: structurizr/java

@Test
public void test_removeSoftwareSystem_RemovesTheSoftwareSystemAndRelationshipsFromTheView() {
  SoftwareSystem softwareSystem1 = model.addSoftwareSystem("Software system 1", "");
  SoftwareSystem softwareSystem2 = model.addSoftwareSystem("Software system 2", "");
  softwareSystem1.uses(softwareSystem2, "uses");
  softwareSystem2.uses(softwareSystem1, "uses");
  view = views.createSystemContextView(softwareSystem1, "key", "description");
  view.add(softwareSystem2);
  assertEquals(2, view.getElements().size());
  assertEquals(2, view.getRelationships().size());
  view.remove(softwareSystem2);
  assertEquals(1, view.getElements().size());
  assertEquals(0, view.getRelationships().size());
}
origin: structurizr/java

public static void main(String[] args) throws Exception {
  Workspace workspace = new Workspace("Documentation - Automatic", "An empty software architecture document using the Structurizr template.");
  Model model = workspace.getModel();
  ViewSet views = workspace.getViews();
  Person user = model.addPerson("User", "A user of my software system.");
  SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "My software system.");
  user.uses(softwareSystem, "Uses");
  SystemContextView contextView = views.createSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram.");
  contextView.addAllSoftwareSystems();
  contextView.addAllPeople();
  Styles styles = views.getConfiguration().getStyles();
  styles.addElementStyle(Tags.PERSON).shape(Shape.Person);
  // this directory includes a mix of Markdown and AsciiDoc files
  File documentationRoot = new File("./structurizr-examples/src/com/structurizr/example/documentation/automatic");
  AutomaticDocumentationTemplate template = new AutomaticDocumentationTemplate(workspace);
  template.addSections(softwareSystem, documentationRoot);
  StructurizrClient structurizrClient = new StructurizrClient(API_KEY, API_SECRET);
  structurizrClient.putWorkspace(WORKSPACE_ID, workspace);
}
origin: structurizr/java

@Test
public void test_copyLayoutInformationFrom_WhenTheSystemContextViewKeysMatch() {
  Workspace workspace1 = createWorkspace();
  SoftwareSystem softwareSystem1 = workspace1.getModel().getSoftwareSystemWithName("Software System");
  SystemContextView view1 = workspace1.getViews().createSystemContextView(softwareSystem1, "context", "Description");
  view1.addAllElements();
  view1.getElements().iterator().next().setX(100);
  view1.setPaperSize(PaperSize.A3_Landscape);
  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());
  assertEquals(100, view2.getElements().iterator().next().getX());
  assertEquals(PaperSize.A3_Landscape, view2.getPaperSize());
}
origin: structurizr/java

@Test
public void test_copyLayoutInformationFrom_CopiesThePaperSize_WhenThePaperSizeIsNotSet() {
  Workspace workspace1 = createWorkspace();
  SoftwareSystem softwareSystem1 = workspace1.getModel().getSoftwareSystemWithName("Software System");
  SystemContextView view1 = workspace1.getViews().createSystemContextView(softwareSystem1, "context", "Description");
  view1.setPaperSize(PaperSize.A3_Landscape);
  Workspace workspace2 = createWorkspace();
  SoftwareSystem softwareSystem2 = workspace2.getModel().getSoftwareSystemWithName("Software System");
  SystemContextView view2 = workspace2.getViews().createSystemContextView(softwareSystem2, "context", "Description");
  workspace2.getViews().copyLayoutInformationFrom(workspace1.getViews());
  assertEquals(PaperSize.A3_Landscape, view2.getPaperSize());
}
origin: structurizr/java

@Test
public void test_copyLayoutInformationFrom_WhenAViewKeyHasBeenIntroduced() {
  Workspace workspace1 = createWorkspace();
  SoftwareSystem softwareSystem1 = workspace1.getModel().getSoftwareSystemWithName("Software System");
  SystemContextView view1 = workspace1.getViews().createSystemContextView(softwareSystem1, "context", "Description");
  view1.setKey(null); // this simulates views created by previous versions of the client library
  view1.addAllElements();
  view1.getElements().iterator().next().setX(100);
  view1.setPaperSize(PaperSize.A3_Landscape);
  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());
  assertEquals(100, view2.getElements().iterator().next().getX());
  assertEquals(PaperSize.A3_Landscape, view2.getPaperSize());
}
origin: structurizr/java

@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());
  assertEquals(0, view2.getElements().iterator().next().getX()); // default
  assertNull(view2.getPaperSize()); // default
}
origin: structurizr/java

public static void main(String[] args) throws Exception {
  Workspace workspace = new Workspace("Corporate Branding", "This is a model of my software system.");
  Model model = workspace.getModel();
  Person user = model.addPerson("User", "A user of my software system.");
  SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "My software system.");
  user.uses(softwareSystem, "Uses");
  ViewSet views = workspace.getViews();
  SystemContextView contextView = views.createSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram.");
  contextView.addAllSoftwareSystems();
  contextView.addAllPeople();
  Styles styles = views.getConfiguration().getStyles();
  styles.addElementStyle(Tags.PERSON).shape(Shape.Person);
  StructurizrDocumentationTemplate template = new StructurizrDocumentationTemplate(workspace);
  template.addContextSection(softwareSystem, Format.Markdown, "Here is some context about the software system...\n\n![](embed:SystemContext)");
  Branding branding = views.getConfiguration().getBranding();
  branding.setLogo(ImageUtils.getImageAsDataUri(new File("./docs/images/structurizr-logo.png")));
  StructurizrClient structurizrClient = new StructurizrClient(API_KEY, API_SECRET);
  structurizrClient.putWorkspace(WORKSPACE_ID, workspace);
}
origin: structurizr/java

@Test
public void test_copyLayoutInformationFrom_WhenAViewKeyIsNotSetButTheViewTitlesMatch() {
  Workspace workspace1 = createWorkspace();
  SoftwareSystem softwareSystem1 = workspace1.getModel().getSoftwareSystemWithName("Software System");
  SystemContextView view1 = workspace1.getViews().createSystemContextView(softwareSystem1, "context", "Description");
  view1.setKey(null); // this simulates views created by previous versions of the client library
  view1.addAllElements();
  view1.getElements().iterator().next().setX(100);
  view1.setPaperSize(PaperSize.A3_Landscape);
  Workspace workspace2 = createWorkspace();
  SoftwareSystem softwareSystem2 = workspace2.getModel().getSoftwareSystemWithName("Software System");
  SystemContextView view2 = workspace2.getViews().createSystemContextView(softwareSystem2, "context", "Description");
  view2.setKey(null); // this simulates views created by previous versions of the client library
  view2.addAllElements();
  workspace2.getViews().copyLayoutInformationFrom(workspace1.getViews());
  assertEquals(100, view2.getElements().iterator().next().getX());
  assertEquals(PaperSize.A3_Landscape, view2.getPaperSize());
}
origin: structurizr/java

@Test
public void test_copyLayoutInformationFrom_IgnoresThePaperSize_WhenThePaperSizeIsSet() {
  Workspace workspace1 = createWorkspace();
  SoftwareSystem softwareSystem1 = workspace1.getModel().getSoftwareSystemWithName("Software System");
  SystemContextView view1 = workspace1.getViews().createSystemContextView(softwareSystem1, "context", "Description");
  view1.setPaperSize(PaperSize.A3_Landscape);
  Workspace workspace2 = createWorkspace();
  SoftwareSystem softwareSystem2 = workspace2.getModel().getSoftwareSystemWithName("Software System");
  SystemContextView view2 = workspace2.getViews().createSystemContextView(softwareSystem2, "context", "Description");
  view2.setPaperSize(PaperSize.A5_Portrait);
  workspace2.getViews().copyLayoutInformationFrom(workspace1.getViews());
  assertEquals(PaperSize.A5_Portrait, view2.getPaperSize());
}
origin: structurizr/java

@Test
public void test_createSystemContextView() {
  Workspace workspace = new Workspace("Name", "Description");
  SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
  SystemContextView systemContextView = workspace.getViews().createSystemContextView(softwareSystem, "key", "Description");
  assertEquals("key", systemContextView.getKey());
  assertEquals("Description", systemContextView.getDescription());
  assertSame(softwareSystem, systemContextView.getSoftwareSystem());
}
origin: structurizr/java

public static void main(String[] args) throws Exception {
  Workspace workspace = new Workspace("Client-side encrypted workspace", "This is a client-side encrypted workspace. The passphrase is 'password'.");
  Model model = workspace.getModel();
  Person user = model.addPerson("User", "A user of my software system.");
  SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "My software system.");
  user.uses(softwareSystem, "Uses");
  ViewSet views = workspace.getViews();
  SystemContextView contextView = views.createSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram.");
  contextView.addAllSoftwareSystems();
  contextView.addAllPeople();
  Styles styles = views.getConfiguration().getStyles();
  styles.addElementStyle(Tags.SOFTWARE_SYSTEM).background("#d34407").color("#ffffff");
  styles.addElementStyle(Tags.PERSON).background("#f86628").color("#ffffff").shape(Shape.Person);
  StructurizrClient structurizrClient = new StructurizrClient(API_KEY, API_SECRET);
  structurizrClient.setEncryptionStrategy(new AesEncryptionStrategy("password"));
  structurizrClient.putWorkspace(WORKSPACE_ID, workspace);
}
origin: structurizr/java

@Test
public void test_putAndGetWorkspace_WithoutEncryption() throws Exception {
  Workspace workspace = new Workspace("Structurizr client library tests - without encryption", "A test workspace for the Structurizr client library");
  SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
  Person person = workspace.getModel().addPerson("Person", "Description");
  person.uses(softwareSystem, "Uses");
  SystemContextView systemContextView = workspace.getViews().createSystemContextView(softwareSystem, "SystemContext", "Description");
  systemContextView.addAllElements();
  structurizrClient.putWorkspace(20081, workspace);
  workspace = structurizrClient.getWorkspace(20081);
  assertTrue(workspace.getModel().contains(softwareSystem));
  assertTrue(workspace.getModel().contains(person));
  assertEquals(1, workspace.getModel().getRelationships().size());
  assertEquals(1, workspace.getViews().getSystemContextViews().size());
  // and check the archive version is readable
  Workspace archivedWorkspace = new JsonReader().read(new FileReader(getArchivedWorkspace()));
  assertEquals(20081, archivedWorkspace.getId());
  assertEquals("Structurizr client library tests - without encryption", archivedWorkspace.getName());
  assertEquals(1, archivedWorkspace.getModel().getSoftwareSystems().size());
}
com.structurizr.viewViewSetcreateSystemContextView

Javadoc

Creates a system context view, where the scope of the view is the specified software system.

Popular methods of ViewSet

  • getConfiguration
    Gets the configuration object associated with this set of views.
  • getSystemContextViews
    Gets the set of system context views.
  • getSystemLandscapeViews
    Gets the set of system landscape views.
  • createComponentView
    Creates a component view, where the scope of the view is the specified container.
  • createDynamicView
    Creates a dynamic view.
  • createSystemLandscapeView
    Creates a system landscape view.
  • getComponentViews
    Gets the set of component views.
  • getContainerViews
    Gets the set of container views.
  • getDynamicViews
    Gets the set of dynamic views.
  • createContainerView
    Creates a container view, where the scope of the view is the specified software system.
  • createDeploymentView
    Creates a deployment view.
  • getDeploymentViews
    Gets the set of dynamic views.
  • createDeploymentView,
  • getDeploymentViews,
  • copyLayoutInformationFrom,
  • createFilteredView,
  • assertThatTheContainerIsNotNull,
  • assertThatTheSoftwareSystemIsNotNull,
  • assertThatTheViewIsNotNull,
  • assertThatTheViewKeyIsSpecifiedAndUnique,
  • findView

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JOptionPane (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now