|
Gridarta Editor
|
Regression tests for ExitConnectorActions. More...
Collaboration diagram for net.sf.gridarta.actions.ExitConnectorActionsTest:Public Member Functions | |
| void | setUp () throws DuplicateArchetypeException |
| Initializes the test case. More... | |
| void | testExitConnect1 () |
| Checks that MapControl, Point) does work. More... | |
| void | testExitConnectAuto1 () |
| Checks that MapControl, Point) does work when auto-creating exit objects. More... | |
| void | testExitCopy1 () |
| Checks that MapControl, Point) does work. More... | |
| void | testExitPaste1 () |
| Checks that MapControl, Point) does work. More... | |
| void | testExitPaste2 () |
| Checks that MapControl, Point) does not crash when connecting to an unsaved map. More... | |
| void | testPath1 () |
| Checks that exit paths are correctly generated. More... | |
Private Member Functions | |
| ExitConnectorActions< TestGameObject, TestMapArchObject, TestArchetype > | createActions (@NotNull final ExitConnectorModel model) |
| Creates a new ExitConnectorActions instance. More... | |
| void | testPath (@NotNull final String mapPathFrom, @NotNull final String mapPathTo, @NotNull final String expectedExitPath) |
| Checks that an exit path is correctly generated. More... | |
Static Private Member Functions | |
| static void | checkExit (@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, @NotNull final Point point, final int index, @Nullable final String exitPath, @Nullable final Point exitPoint) |
| Checks that a map model contains an exit game object. More... | |
Private Attributes | |
| TestMapModelHelper | mapModelHelper |
| The TestMapModelHelper instance. More... | |
| TestMapControlCreator | testMapControlCreator |
| The TestMapControlCreator for creating maps. More... | |
Static Private Attributes | |
| static final MapFile | BASE = new MapFile(new File("/tmp")) |
| The base MapFile for the test. More... | |
| static final MapFile | MAP_FILE1 = new MapFile(BASE, "a") |
| The first map file. More... | |
| static final MapFile | MAP_FILE2 = new MapFile(BASE, "b") |
| The second map file. More... | |
| static final String | MAP_NAME1 = "name1" |
| The first map name. More... | |
| static final String | MAP_NAME2 = "name2" |
| The second map name. More... | |
Regression tests for ExitConnectorActions.
Definition at line 50 of file ExitConnectorActionsTest.java.
|
staticprivate |
Checks that a map model contains an exit game object.
| mapModel | the map model to check |
| point | the position to check |
| index | the index to check |
| exitPath | the expected exit path or null |
| exitPoint | the expected exit destination or null |
Definition at line 408 of file ExitConnectorActionsTest.java.
References net.sf.gridarta.model.mapmodel.TestMapModelHelper.EXIT_TYPE, net.sf.gridarta.model.baseobject.BaseObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, T extends BaseObject< G, A, R, T >.HP, net.sf.gridarta.model.baseobject.BaseObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, T extends BaseObject< G, A, R, T >.SLAYING, and net.sf.gridarta.model.baseobject.BaseObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, T extends BaseObject< G, A, R, T >.SP.
Referenced by net.sf.gridarta.actions.ExitConnectorActionsTest.testExitConnect1(), net.sf.gridarta.actions.ExitConnectorActionsTest.testExitConnectAuto1(), net.sf.gridarta.actions.ExitConnectorActionsTest.testExitPaste1(), and net.sf.gridarta.actions.ExitConnectorActionsTest.testPath().
Here is the caller graph for this function:
|
private |
Creates a new ExitConnectorActions instance.
| model | the exit connector model to use |
Definition at line 392 of file ExitConnectorActionsTest.java.
References net.sf.gridarta.model.mapcontrol.TestMapControlCreator.getArchetypeSet(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.getExitMatcher(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.getInsertionModeSet(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.getMapManager(), and net.sf.gridarta.actions.ExitConnectorActionsTest.testMapControlCreator.
Referenced by net.sf.gridarta.actions.ExitConnectorActionsTest.testExitConnect1(), net.sf.gridarta.actions.ExitConnectorActionsTest.testExitConnectAuto1(), net.sf.gridarta.actions.ExitConnectorActionsTest.testExitCopy1(), net.sf.gridarta.actions.ExitConnectorActionsTest.testExitPaste1(), net.sf.gridarta.actions.ExitConnectorActionsTest.testExitPaste2(), and net.sf.gridarta.actions.ExitConnectorActionsTest.testPath().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.actions.ExitConnectorActionsTest.setUp | ( | ) | throws DuplicateArchetypeException |
Initializes the test case.
| DuplicateArchetypeException | if the test case fails |
Definition at line 382 of file ExitConnectorActionsTest.java.
References net.sf.gridarta.model.mapcontrol.TestMapControlCreator.newMapModelCreator().
Here is the call graph for this function:| void net.sf.gridarta.actions.ExitConnectorActionsTest.testExitConnect1 | ( | ) |
Checks that MapControl, Point) does work.
Definition at line 204 of file ExitConnectorActionsTest.java.
References net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.beginTransaction(), net.sf.gridarta.actions.ExitConnectorActionsTest.checkExit(), net.sf.gridarta.actions.ExitConnectorActionsTest.createActions(), net.sf.gridarta.actions.ExitConnectorActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExitConnect(), net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.endTransaction(), net.sf.gridarta.model.mapcontrol.MapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapModel(), net.sf.gridarta.model.mapmodel.TestMapModelHelper.insertExit(), net.sf.gridarta.model.mapmodel.TestMapModelHelper.insertFloor(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.newMapControl(), and net.sf.gridarta.model.exitconnector.ExitConnectorModel.setExitLocation().
Here is the call graph for this function:| void net.sf.gridarta.actions.ExitConnectorActionsTest.testExitConnectAuto1 | ( | ) |
Checks that MapControl, Point) does work when auto-creating exit objects.
Definition at line 272 of file ExitConnectorActionsTest.java.
References net.sf.gridarta.actions.ExitConnectorActionsTest.checkExit(), net.sf.gridarta.actions.ExitConnectorActionsTest.createActions(), net.sf.gridarta.actions.ExitConnectorActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExitConnect(), net.sf.gridarta.model.mapcontrol.MapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapModel(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.newMapControl(), net.sf.gridarta.model.exitconnector.ExitConnectorModel.setAutoCreateExit(), net.sf.gridarta.model.exitconnector.ExitConnectorModel.setExitArchetypeName(), and net.sf.gridarta.model.exitconnector.ExitConnectorModel.setExitLocation().
Here is the call graph for this function:| void net.sf.gridarta.actions.ExitConnectorActionsTest.testExitCopy1 | ( | ) |
Checks that MapControl, Point) does work.
Definition at line 95 of file ExitConnectorActionsTest.java.
References net.sf.gridarta.actions.ExitConnectorActionsTest.createActions(), net.sf.gridarta.actions.ExitConnectorActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExitCopy(), net.sf.gridarta.model.exitconnector.ExitConnectorModel.getExitLocation(), net.sf.gridarta.model.mapcontrol.MapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapModel(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.newMapControl(), and net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setMapFile().
Here is the call graph for this function:| void net.sf.gridarta.actions.ExitConnectorActionsTest.testExitPaste1 | ( | ) |
Checks that MapControl, Point) does work.
Definition at line 124 of file ExitConnectorActionsTest.java.
References net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.beginTransaction(), net.sf.gridarta.actions.ExitConnectorActionsTest.checkExit(), net.sf.gridarta.actions.ExitConnectorActionsTest.createActions(), net.sf.gridarta.actions.ExitConnectorActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExitPaste(), net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.endTransaction(), net.sf.gridarta.model.mapcontrol.MapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapModel(), net.sf.gridarta.model.mapmodel.TestMapModelHelper.insertExit(), net.sf.gridarta.model.mapmodel.TestMapModelHelper.insertFloor(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.newMapControl(), and net.sf.gridarta.model.exitconnector.ExitConnectorModel.setExitLocation().
Here is the call graph for this function:| void net.sf.gridarta.actions.ExitConnectorActionsTest.testExitPaste2 | ( | ) |
Checks that MapControl, Point) does not crash when connecting to an unsaved map.
Definition at line 174 of file ExitConnectorActionsTest.java.
References net.sf.gridarta.actions.ExitConnectorActionsTest.createActions(), net.sf.gridarta.actions.ExitConnectorActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExitCopy(), net.sf.gridarta.actions.ExitConnectorActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExitPaste(), net.sf.gridarta.model.mapcontrol.MapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapModel(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.newMapControl(), net.sf.gridarta.model.exitconnector.ExitConnectorModel.setAutoCreateExit(), net.sf.gridarta.model.exitconnector.ExitConnectorModel.setExitLocation(), and net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setMapFile().
Here is the call graph for this function:
|
private |
Checks that an exit path is correctly generated.
| mapPathFrom | the map path to connect from; this map contains the exit object |
| mapPathTo | the map path to connect to |
| expectedExitPath | the expected map in the exit object |
Definition at line 345 of file ExitConnectorActionsTest.java.
References net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.beginTransaction(), net.sf.gridarta.actions.ExitConnectorActionsTest.checkExit(), net.sf.gridarta.actions.ExitConnectorActionsTest.createActions(), net.sf.gridarta.actions.ExitConnectorActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExitPaste(), net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.endTransaction(), net.sf.gridarta.model.mapcontrol.MapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapModel(), net.sf.gridarta.model.settings.ProjectSettings.getMapsDirectory(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.getProjectSettings(), net.sf.gridarta.model.mapmodel.TestMapModelHelper.insertExit(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.newMapControl(), net.sf.gridarta.model.mapmodel.MapPathUtils.newMapPath(), and net.sf.gridarta.model.exitconnector.ExitConnectorModel.setExitLocation().
Referenced by net.sf.gridarta.actions.ExitConnectorActionsTest.testPath1().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.actions.ExitConnectorActionsTest.testPath1 | ( | ) |
Checks that exit paths are correctly generated.
Definition at line 318 of file ExitConnectorActionsTest.java.
References net.sf.gridarta.actions.ExitConnectorActionsTest.testPath().
Here is the call graph for this function:
|
staticprivate |
The base MapFile for the test.
Definition at line 56 of file ExitConnectorActionsTest.java.
|
staticprivate |
The first map file.
Definition at line 61 of file ExitConnectorActionsTest.java.
|
staticprivate |
The second map file.
Definition at line 71 of file ExitConnectorActionsTest.java.
|
staticprivate |
The first map name.
Definition at line 66 of file ExitConnectorActionsTest.java.
|
staticprivate |
The second map name.
Definition at line 76 of file ExitConnectorActionsTest.java.
|
private |
The TestMapModelHelper instance.
Definition at line 88 of file ExitConnectorActionsTest.java.
|
private |
The TestMapControlCreator for creating maps.
Definition at line 82 of file ExitConnectorActionsTest.java.
Referenced by net.sf.gridarta.actions.ExitConnectorActionsTest.createActions().