 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.io;
22 import java.io.IOException;
39 import org.jetbrains.annotations.NotNull;
40 import org.jetbrains.annotations.Nullable;
41 import org.junit.Assert;
42 import org.junit.Test;
62 check(
"end\n",
false,
true, 0);
71 final StringBuilder input =
new StringBuilder();
72 input.append(
"Object test\n");
73 input.append(
"end\n");
74 check(input.toString(),
false,
false, 1);
83 check(
"Object test\n",
true,
false, 0);
93 final StringBuilder input =
new StringBuilder();
94 input.append(
"Object test\n");
95 input.append(
"msg\n");
96 input.append(
"endmsg\n");
97 input.append(
"end\n");
98 check(input.toString(),
false,
false, 1);
99 Assert.assertNull(
getArchetypeSet().getArchetype(
"test").getMsgText(
false));
109 final StringBuilder input =
new StringBuilder();
110 input.append(
"Object test\n");
111 input.append(
"msg\n");
112 input.append(
"abc\n");
113 input.append(
"def\n");
114 input.append(
"ghi\n");
115 input.append(
"endmsg\n");
116 input.append(
"end\n");
117 check(input.toString(),
false,
false, 1);
118 final StringBuilder msgText =
new StringBuilder();
119 msgText.append(
"abc\n");
120 msgText.append(
"def\n");
121 msgText.append(
"ghi\n");
122 Assert.assertEquals(msgText.toString(),
getArchetypeSet().getArchetype(
"test").getMsgText(
false));
132 final StringBuilder input =
new StringBuilder();
133 input.append(
"Object test\n");
134 input.append(
"msg\n");
135 input.append(
"abc \n");
136 input.append(
"def\n");
137 input.append(
"ghi \n");
139 input.append(
"endmsg\n");
140 input.append(
"end\n");
141 check(input.toString(),
false,
false, 1);
142 final StringBuilder msgText =
new StringBuilder();
143 msgText.append(
"abc\n");
144 msgText.append(
"def\n");
145 msgText.append(
"ghi\n");
146 msgText.append(
"\n");
147 Assert.assertEquals(msgText.toString(),
getArchetypeSet().getArchetype(
"test").getMsgText(
false));
157 final StringBuilder input =
new StringBuilder();
158 input.append(
"Object test\n");
159 input.append(
"msg\n");
161 input.append(
" abc\n");
162 input.append(
"def\n");
163 input.append(
" ghi\n");
164 input.append(
"endmsg\n");
165 input.append(
"end\n");
166 check(input.toString(),
false,
false, 1);
167 final StringBuilder msgText =
new StringBuilder();
168 msgText.append(
"\n");
169 msgText.append(
" abc\n");
170 msgText.append(
"def\n");
171 msgText.append(
" ghi\n");
172 Assert.assertEquals(msgText.toString(),
getArchetypeSet().getArchetype(
"test").getMsgText(
false));
181 final StringBuilder input =
new StringBuilder();
182 input.append(
"Object test\n");
183 input.append(
"msg\n");
184 input.append(
"abc\n");
185 input.append(
"def\n");
186 check(input.toString(),
true,
false, 0);
209 if (result ==
null) {
210 throw new IllegalStateException(
"archetype set is unset");
An Archetype implementation for testing purposes.
Base package of all Gridarta classes.
Exception thrown if an Archetype does not exist.
Abstract base implementation of ArchetypeParser.
void testMissingEnd()
Checks that a missing "end" line is reported.
AnimationObjects is a container for AnimationObjects.
A GameObject implementation for testing purposes.
Provider for faces of GameObjects and Archetypes.
void testMsgTextTrailingWhitespace()
Checks that msg...endmsg fields are parsed correctly.
An AnimationObjects for regression tests.
void testMsgTextLeadingWhitespace()
Checks that msg...endmsg fields are parsed correctly.
AbstractArchetypeParser< TestGameObject, TestMapArchObject, TestArchetype, ? extends AbstractArchetypeBuilder< TestGameObject, TestMapArchObject, TestArchetype > > newArchetypeParser()
void testMsgTextLines()
Checks that msg...endmsg fields are parsed correctly.
GameObjects are the objects based on Archetypes found on maps.
Regression tests for AbstractArchetypeParser.
A GameObjectFactory for regression tests.
ArchetypeSet< TestGameObject, TestMapArchObject, TestArchetype > getArchetypeSet()
FaceObjects is a container for FaceObjects.
void testMsgTextTruncated()
Checks that msg...endmsg fields are parsed correctly.
void check( @NotNull final String input, final boolean hasErrors, final boolean hasWarnings, final int archetypes)
Creates a new archetype parser and parses the given input.
Interface that captures similarities between different ArchetypeSet implementations.
void testEmpty()
Checks that an empty archetype can be parsed.
An AbstractArchetypeBuilder for regression tests.
Creates Archetype instances.
An ArchetypeFactory implementation for testing purposes.
ArchetypeSet< TestGameObject, TestMapArchObject, TestArchetype > archetypeSet
The loaded archetypes.
Abstract base class for regression tests for ArchetypeParser.
An ArchetypeParser for regression tests.
void testMissingObject()
Checks that a missing "object" line is detected.
The face is the appearance of an object.
Gridarta can handle frame information of animations and allow the selection of an animation using a t...
void testMsgTextEmpty()
Checks that msg...endmsg fields are parsed correctly.
A MapArchObject implementation for testing purposes.
Creates ImageIcon instances from resources.
Base implementation of ArchetypeSet.
A FaceObjects for regression tests.