 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.autojoin;
29 import org.junit.Assert;
30 import org.junit.Test;
47 autojoinListsHelper.
newAutojoinListsFail(
"autojoin list with less than 16 valid entries",
"a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"a7",
"a8",
"a9",
"a10",
"a11",
"a12",
"a13",
"a14");
48 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"a7",
"a8",
"a9",
"a10",
"a11",
"a12",
"a13",
"a14",
"a15");
49 autojoinListsHelper.
newAutojoinListsFail(
"autojoin list with more than 16 valid entries",
"a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"a7",
"a8",
"a9",
"a10",
"a11",
"a12",
"a13",
"a14",
"a15",
"a16");
61 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"a7",
"a8",
"a9",
"a10",
"a11",
"a12",
"a13",
"a14",
"a0");
71 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"a7",
"a8",
"a9",
"a10",
"a11",
"a12",
"a13",
"a14",
"a15");
72 autojoinListsHelper.
newAutojoinListsFail(
"archetype 'a4' contained in more than one autojoin list",
"b0",
"b1",
"b2",
"b3",
"a4",
"b5",
"b6",
"b7",
"b8",
"b9",
"b10",
"b11",
"b12",
"b13",
"b14",
"b15");
73 autojoinListsHelper.
newAutojoinListsFail(
"autojoin list contains duplicate archetype 'c0'",
"c0|c1|c0",
"c1",
"c2",
"c3",
"c4",
"c5",
"c6",
"c7",
"c8",
"c9",
"c10",
"c11",
"c12",
"c13",
"c14",
"c15");
74 autojoinListsHelper.
newAutojoinListsFail(
"autojoin list is empty",
"d0",
"d1",
"d2",
"",
"d4",
"d5",
"d6",
"d7",
"d8",
"d9",
"d10",
"d11",
"d12",
"d13",
"d14",
"d15");
86 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"a7",
"a8",
"a9",
"a10",
"a11",
"a12",
"a13",
"a14",
"a15");
105 }
catch (
final IllegalArgumentException ignored) {
128 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"a7",
"a8",
"a9",
"a10",
"a11",
"a12",
"a13",
"a14",
"a15");
164 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5|b5",
"a6",
"a7",
"a8",
"a9",
"a10|b10",
"a11",
"a12",
"a13",
"a14",
"a15");
193 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5|b5",
"a6",
"a7",
"a8",
"a9",
"a10|b10",
"a11",
"a12",
"a13",
"a14",
"a15");
221 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5|b5",
"a6",
"a7",
"a8",
"a9",
"a10|b10",
"a11",
"a12",
"a13",
"a14",
"a15");
249 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5|b5",
"a6",
"a7",
"a8",
"a9",
"a10|b10",
"a11",
"a12",
"a13",
"a14",
"a15");
276 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5|b5",
"a6",
"a7",
"a8",
"a9",
"a10|b10",
"a11",
"a12",
"a13",
"a14",
"a15");
304 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5|b5",
"a6",
"a7",
"a8",
"a9",
"a10|b10",
"a11",
"a12",
"a13",
"a14",
"a15");
330 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5|b5",
"a6",
"a7",
"a8",
"a9",
"a10|b10",
"a11",
"a12",
"a13",
"a14",
"a15");
348 }
catch (
final IllegalArgumentException ignored) {
354 }
catch (
final IllegalArgumentException ignored) {
369 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5|b5",
"a6",
"a7",
"a8",
"a9",
"a10|b10",
"a11",
"a12",
"a13",
"a14",
"a15");
378 for (
int y = 0; y < 3; y++) {
379 for (
int x = 0; x < 3; x++) {
396 }
catch (
final IllegalArgumentException ignored) {
403 }
catch (
final IllegalArgumentException ignored) {
An Archetype implementation for testing purposes.
A MapModel reflects the data of a map.
TestMapModelHelper newTestMapModelHelper()
Creates a new TestMapModelHelper instance.
Base package of all Gridarta classes.
void testDuplicateArchetype1()
Checks that duplicate archetypes are detected.
Helper class for creating MapModel instances for regression tests.
void newAutojoinLists(@NotNull final String... archetypeNames)
Creates a new AutojoinLists instance.
void testInsert1()
Checks that inserting with autojoin works as expected.
Regression tests for AutojoinLists.
A GameObject implementation for testing purposes.
void testInsertReplace1()
Checks that replacing archetypes works as expected.
void beginTransaction(@NotNull String name)
Starts a new transaction.
Helper class for regression tests to create MapModel instances.
Implements AutojoinList related functions.
void testRemove1()
Checks that removing with autojoin works as expected.
void testWrongCount()
Checks that a wrong number of archetypes is detected.
void testRemoveAlt3()
Checks that removing alternative archetypes with autojoin works as expected.
GameObjects are the objects based on Archetypes found on maps.
MapModel< TestGameObject, TestMapArchObject, TestArchetype > newMapModel(final int w, final int h)
Creates a new MapModel instance.
void testInsertDuplicate1()
Checks that inserting duplicate archetypes with autojoin works as expected.
void newAutojoinListsFail(@NotNull final String expectedException, @NotNull final String... archetypeNames)
Creates a new AutojoinLists instance and expects an error.
void testRemoveAlt1()
Checks that removing alternative archetypes with autojoin works as expected.
void removeGameObject(@NotNull G gameObject, boolean join)
Delete an existing GameObject from the map.
void testDuplicateArchetype2()
Checks that duplicate archetypes are detected.
Exception thrown if an AutojoinList is invalid.
void testInsertAlt3()
Checks that inserting alternative archetypes with autojoin works as expected.
TestGameObject insertArchetype(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, final int x, final int y, @NotNull final BaseObject< TestGameObject, TestMapArchObject, TestArchetype, ?> archetype, final boolean join)
Inserts an archetype game object into a map model.
TestArchetype getArchetype(@NotNull final String archetypeName)
Returns an archetype.
void testRemoveAlt2()
Checks that removing alternative archetypes with autojoin works as expected.
static void checkMapContents(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, @NotNull final String... lines)
Checks for expected MapModel's contents.
An Exception indicating that an Archetype name is not unique.
A MapArchObject implementation for testing purposes.
void testInsertAlt2()
Checks that inserting alternative archetypes with autojoin works as expected.
void testInsertAlt1()
Checks that inserting alternative archetypes with autojoin works as expected.