Gridarta Editor
net.sf.gridarta.actions.ExitConnectorActionsTest Class Reference

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, TestArchetypecreateActions (@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...
 

Detailed Description

Regression tests for ExitConnectorActions.

Author
Andreas Kirschbaum

Definition at line 50 of file ExitConnectorActionsTest.java.

Member Function Documentation

◆ checkExit()

static void net.sf.gridarta.actions.ExitConnectorActionsTest.checkExit ( @NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype mapModel,
@NotNull final Point  point,
final int  index,
@Nullable final String  exitPath,
@Nullable final Point  exitPoint 
)
staticprivate

◆ createActions()

◆ setUp()

void net.sf.gridarta.actions.ExitConnectorActionsTest.setUp ( ) throws DuplicateArchetypeException

Initializes the test case.

Exceptions
DuplicateArchetypeExceptionif 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:

◆ testExitConnect1()

◆ testExitConnectAuto1()

◆ testExitCopy1()

◆ testExitPaste1()

◆ testExitPaste2()

◆ testPath()

void net.sf.gridarta.actions.ExitConnectorActionsTest.testPath ( @NotNull final String  mapPathFrom,
@NotNull final String  mapPathTo,
@NotNull final String  expectedExitPath 
)
private

Checks that an exit path is correctly generated.

Parameters
mapPathFromthe map path to connect from; this map contains the exit object
mapPathTothe map path to connect to
expectedExitPaththe 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:

◆ testPath1()

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:

Member Data Documentation

◆ BASE

final MapFile net.sf.gridarta.actions.ExitConnectorActionsTest.BASE = new MapFile(new File("/tmp"))
staticprivate

The base MapFile for the test.

Definition at line 56 of file ExitConnectorActionsTest.java.

◆ MAP_FILE1

final MapFile net.sf.gridarta.actions.ExitConnectorActionsTest.MAP_FILE1 = new MapFile(BASE, "a")
staticprivate

The first map file.

Definition at line 61 of file ExitConnectorActionsTest.java.

◆ MAP_FILE2

final MapFile net.sf.gridarta.actions.ExitConnectorActionsTest.MAP_FILE2 = new MapFile(BASE, "b")
staticprivate

The second map file.

Definition at line 71 of file ExitConnectorActionsTest.java.

◆ MAP_NAME1

final String net.sf.gridarta.actions.ExitConnectorActionsTest.MAP_NAME1 = "name1"
staticprivate

The first map name.

Definition at line 66 of file ExitConnectorActionsTest.java.

◆ MAP_NAME2

final String net.sf.gridarta.actions.ExitConnectorActionsTest.MAP_NAME2 = "name2"
staticprivate

The second map name.

Definition at line 76 of file ExitConnectorActionsTest.java.

◆ mapModelHelper

TestMapModelHelper net.sf.gridarta.actions.ExitConnectorActionsTest.mapModelHelper
private

The TestMapModelHelper instance.

Definition at line 88 of file ExitConnectorActionsTest.java.

◆ testMapControlCreator

TestMapControlCreator net.sf.gridarta.actions.ExitConnectorActionsTest.testMapControlCreator
private

The documentation for this class was generated from the following file: