-
-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a findTerminology() method on the Terminology class.
- Loading branch information
1 parent
04af66c
commit c79d3a8
Showing
4 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
structurizr-core/test/unit/com/structurizr/view/TerminologyTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.structurizr.view; | ||
|
||
import com.structurizr.Workspace; | ||
import com.structurizr.model.*; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class TerminologyTests { | ||
|
||
@Test | ||
public void test_findTerminology() { | ||
Workspace workspace = new Workspace("Name", "Description"); | ||
Terminology terminology = workspace.getViews().getConfiguration().getTerminology(); | ||
Person person = workspace.getModel().addPerson("Name"); | ||
SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Name"); | ||
Container container = softwareSystem.addContainer("Container"); | ||
Component component = container.addComponent("Component"); | ||
DeploymentNode deploymentNode = workspace.getModel().addDeploymentNode("Deployment Node"); | ||
InfrastructureNode infrastructureNode = deploymentNode.addInfrastructureNode("Infrastructure Node"); | ||
SoftwareSystemInstance softwareSystemInstance = deploymentNode.add(softwareSystem); | ||
ContainerInstance containerInstance = deploymentNode.add(container); | ||
Relationship relationship = person.uses(softwareSystem, "Uses"); | ||
|
||
assertEquals("Person", terminology.findTerminology(person)); | ||
assertEquals("Software System", terminology.findTerminology(softwareSystem)); | ||
assertEquals("Container", terminology.findTerminology(container)); | ||
assertEquals("Component", terminology.findTerminology(component)); | ||
assertEquals("Deployment Node", terminology.findTerminology(deploymentNode)); | ||
assertEquals("Infrastructure Node", terminology.findTerminology(infrastructureNode)); | ||
assertEquals("Software System", terminology.findTerminology(softwareSystemInstance)); | ||
assertEquals("Container", terminology.findTerminology(containerInstance)); | ||
assertEquals("Relationship", terminology.findTerminology(relationship)); | ||
|
||
terminology.setPerson("PERSON"); | ||
terminology.setSoftwareSystem("SOFTWARE SYSTEM"); | ||
terminology.setContainer("CONTAINER"); | ||
terminology.setComponent("COMPONENT"); | ||
terminology.setDeploymentNode("DEPLOYMENT NODE"); | ||
terminology.setInfrastructureNode("INFRASTRUCTURE NODE"); | ||
terminology.setRelationship("RELATIONSHIP"); | ||
|
||
assertEquals("PERSON", terminology.findTerminology(person)); | ||
assertEquals("SOFTWARE SYSTEM", terminology.findTerminology(softwareSystem)); | ||
assertEquals("CONTAINER", terminology.findTerminology(container)); | ||
assertEquals("COMPONENT", terminology.findTerminology(component)); | ||
assertEquals("DEPLOYMENT NODE", terminology.findTerminology(deploymentNode)); | ||
assertEquals("INFRASTRUCTURE NODE", terminology.findTerminology(infrastructureNode)); | ||
assertEquals("SOFTWARE SYSTEM", terminology.findTerminology(softwareSystemInstance)); | ||
assertEquals("CONTAINER", terminology.findTerminology(containerInstance)); | ||
assertEquals("RELATIONSHIP", terminology.findTerminology(relationship)); | ||
} | ||
|
||
} |