20 package net.sf.gridarta.model.mapcontrol;
22 import java.awt.Point;
24 import java.io.IOException;
31 import org.junit.Assert;
32 import org.junit.Test;
47 public void testSave1() throws IOException, InterruptedException {
54 Assert.assertTrue(mapFile.
getFile().exists());
67 public void testSaveAs1() throws IOException, InterruptedException {
84 mapControl.
saveAs(mapFile);
85 Assert.assertTrue(mapFile.
getFile().exists());
void save()
Saves the map to a file.
void testSaveAs1()
Checks that MapControl#saveAs(MapFile) does update the map's file and that it does reset the map's mo...
A MapModel reflects the data of a map.
static void deleteTempDir(@NotNull final File dir)
Deletes a temporary directory.
PathManager getPathManager()
Returns the PathManager.
void endTransaction()
End a transaction.
TestMapModelCreator getMapModelCreator()
Returns the TestMapModelCreator instance.
Helper class for creating MapControl instances for regression tests.
Regression tests for DefaultMapControl.
MapFile getMapFile(@NotNull final AbsoluteMapPath mapPath)
Returns a MapFile instance from an AbsoluteMapPath.
boolean isModified()
Return whether the map has been modified from the on-disk state.
A MapArchObject implementation for testing purposes.
MapModel< G, A, R > getMapModel()
Returns the map model.
Base package of all Gridarta classes.
void addGameObjectToMap(@NotNull G gameObject, @NotNull Point pos, @NotNull InsertionMode< G, A, R > insertionMode)
Add a gameObject to the map.
File createMapsDirectory(@NotNull final String... specs)
Creates a maps directory consisting of a set of maps.
TestGameObject newGameObject(@NotNull final String archetypeName, @NotNull final String objectName)
Creates a new game object.
GameObjects are the objects based on Archetypes found on maps.
void testSave1()
Checks that MapControl#save() does not fail if the path to the map file does not yet exist...
ProjectSettings getProjectSettings()
Returns the ProjectSettings.
Currently nothing more than a marker interface for unification.
MapFile getMapFile()
Returns the map file.
File getFile()
Returns a File for this map file.
An Archetype implementation for testing purposes.
A GameObject implementation for testing purposes.
File getMapsDirectory()
Returns the default maps directory.
InsertionMode< TestGameObject, TestMapArchObject, TestArchetype > getTopmostInsertionMode()
Returns the "topmost" insertion mode.
void saveAs(@NotNull MapFile mapFile)
Saves the file with the given map file.
void beginTransaction(@NotNull String name)
Starts a new transaction.
The location of a map file with a map directory.
The class Size2D represents a 2d rectangular area.
MapControl< TestGameObject, TestMapArchObject, TestArchetype > newMapControl(@Nullable final MapFile mapFile, @NotNull final String mapName, @NotNull final Size2D mapSize)
Creates a new map control.