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

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

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

origin: structurizr/java

@Test
public void test_createSystemLandscapeView_DoesNotThrowAnException_WhenUniqueKeysAreSpecified() {
  Workspace workspace = new Workspace("Name", "Description");
  workspace.getViews().createSystemLandscapeView("key1", "Description");
  workspace.getViews().createSystemLandscapeView("key2", "Description");
}
origin: structurizr/java

@Test
public void test_createSystemLandscapeView_ThrowsAnException_WhenADuplicateKeyIsSpecified() {
  try {
    Workspace workspace = new Workspace("Name", "Description");
    workspace.getViews().createSystemLandscapeView("key", "Description");
    workspace.getViews().createSystemLandscapeView("key", "Description");
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("A view with the key key already exists.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_setEnterpriseContextViews_IsSupportedForOlderWorkspaces() {
  ViewSet views = new Workspace("", "").getViews();
  SystemLandscapeView systemLandscapeView = views.createSystemLandscapeView("key", "Description");
  views.setEnterpriseContextViews(Collections.singleton(systemLandscapeView));
  assertEquals(1, views.getSystemLandscapeViews().size());
  assertSame(systemLandscapeView, views.getSystemLandscapeViews().iterator().next());
}
origin: structurizr/java

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

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

@Test
public void test_addAnimationStep_ThrowsAnException_WhenNoElementsAreSpecified() {
  try {
    SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("key", "Description");
    view.addAnimation();
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("One or more elements must be specified.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_addAnimationStep_IgnoresElementsThatDoNotExistInTheView() {
  SoftwareSystem element1 = model.addSoftwareSystem("Software System 1", "");
  SoftwareSystem element2 = model.addSoftwareSystem("Software System 2", "");
  SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("key", "Description");
  view.add(element1);
  view.addAnimation(element1, element2);
  Animation step1 = view.getAnimations().stream().filter(step -> step.getOrder() == 1).findFirst().get();
  assertEquals(1, step1.getElements().size());
  assertTrue(step1.getElements().contains(element1.getId()));
}
origin: structurizr/java

@Test
public void test_backwardsCompatibilityOfRenamingEnterpriseContextViewsToSystemLandscapeViews() throws Exception {
  Workspace workspace = new Workspace("Name", "Description");
  workspace.getViews().createSystemLandscapeView("key", "description");
  JsonWriter jsonWriter = new JsonWriter(false);
  StringWriter stringWriter = new StringWriter();
  jsonWriter.write(workspace, stringWriter);
  String workspaceAsJson = stringWriter.toString();
  workspaceAsJson = workspaceAsJson.replaceAll("systemLandscapeViews", "enterpriseContextViews");
  JsonReader jsonReader = new JsonReader();
  StringReader stringReader = new StringReader(workspaceAsJson);
  workspace = jsonReader.read(stringReader);
  assertEquals(1, workspace.getViews().getSystemLandscapeViews().size());
}
origin: structurizr/java

@Test
public void test_addAnimationStep_ThrowsAnException_WhenElementsAreSpecifiedButNoneOfThemExistInTheView() {
  try {
    SoftwareSystem element1 = model.addSoftwareSystem("Software System 1", "");
    SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("key", "Description");
    view.addAnimation(element1);
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("None of the specified elements exist in this view.", iae.getMessage());
  }
}
origin: structurizr/java

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

@Test
public void test_createFilteredView_ThrowsAnException_WhenANullKeyIsSpecified() {
  try {
    Workspace workspace = new Workspace("Name", "Description");
    SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("systemLandscape", "Description");
    workspace.getViews().createFilteredView(view, null, "Description", FilterMode.Include, "tag1", "tag2");
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("A key must be specified.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_isEmpty_ReturnsFalse_WhenThereAreViews() {
  workspace = new Workspace("Name", "Description");
  workspace.getViews().createSystemLandscapeView("key", "Description");
  assertFalse(workspace.isEmpty());
}
origin: structurizr/java

@Test
public void test_defaultView() {
  SystemLandscapeView view = views.createSystemLandscapeView("key", "Description");
  Configuration configuration = new Configuration();
  configuration.setDefaultView(view);
  assertEquals("key", configuration.getDefaultView());
}
origin: structurizr/java

@Test
public void test_removeElementsWithNoRelationships_RemovesAllElements_WhenTheViewHasNoRelationshipsBetweenElements() {
  SoftwareSystem softwareSystem = model.addSoftwareSystem(Location.Internal, "Software System", "Description");
  Person person = model.addPerson(Location.Unspecified, "Person", "Description");
  StaticView view = views.createSystemLandscapeView("context", "Description");
  view.addAllSoftwareSystems();
  view.addAllPeople();
  view.removeElementsWithNoRelationships();
  assertEquals(0, view.getElements().size());
}
origin: structurizr/java

@Test
public void test_createFilteredView_ThrowsAnException_WhenADuplicateKeyIsUsed() {
  Workspace workspace = new Workspace("Name", "Description");
  SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("systemLandscape", "Description");
  workspace.getViews().createFilteredView(view, "filtered", "Description", FilterMode.Include, "tag1", "tag2");
  try {
    workspace.getViews().createFilteredView(view, "filtered", "Description", FilterMode.Include, "tag1", "tag2");
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("A view with the key filtered already exists.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_addElement_ThrowsAnException_WhenTheSpecifiedElementDoesNotExistInTheModel() {
  try {
    Workspace workspace = new Workspace("1", "");
    SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description");
    SystemLandscapeView view = new Workspace("", "").getViews().createSystemLandscapeView("key", "Description");
    view.add(softwareSystem);
    fail();
  } catch (IllegalArgumentException iae) {
    assertEquals("The element named Software System does not exist in the model associated with this view.", iae.getMessage());
  }
}
origin: structurizr/java

@Test
public void test_createSystemLandscapeView() {
  Workspace workspace = new Workspace("Name", "Description");
  SystemLandscapeView systemLandscapeView = workspace.getViews().createSystemLandscapeView("key", "Description");
  assertEquals("key", systemLandscapeView.getKey());
  assertEquals("Description", systemLandscapeView.getDescription());
}
origin: structurizr/java

@Test
public void test_copyLayoutInformationFrom_WhenTheSystemLandscapeViewKeysMatch() {
  Workspace workspace1 = createWorkspace();
  SoftwareSystem softwareSystem1 = workspace1.getModel().getSoftwareSystemWithName("Software System");
  SystemLandscapeView view1 = workspace1.getViews().createSystemLandscapeView("landscape", "Description");
  view1.addAllElements();
  view1.getElements().iterator().next().setX(100);
  view1.setPaperSize(PaperSize.A3_Landscape);
  Workspace workspace2 = createWorkspace();
  SoftwareSystem softwareSystem2 = workspace2.getModel().getSoftwareSystemWithName("Software System");
  SystemLandscapeView view2 = workspace2.getViews().createSystemLandscapeView("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_createFilteredView() {
  Workspace workspace = new Workspace("Name", "Description");
  SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("systemLandscape", "Description");
  FilteredView filteredView = workspace.getViews().createFilteredView(view, "key", "Description", FilterMode.Include, "tag1", "tag2");
  assertEquals("key", filteredView.getKey());
  assertEquals("Description", filteredView.getDescription());
  assertEquals(FilterMode.Include, filteredView.getMode());
  assertEquals(2, filteredView.getTags().size());
  assertTrue(filteredView.getTags().contains("tag1"));
  assertTrue(filteredView.getTags().contains("tag2"));
}
origin: structurizr/java

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

Javadoc

Creates a system landscape view.

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.
  • createSystemContextView
    Creates a system context view, where the scope of the view is the specified software system.
  • 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

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Collectors (java.util.stream)
  • ImageIO (javax.imageio)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • CodeWhisperer 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