20 package net.sf.gridarta.model.archetypetype;
22 import java.util.Iterator;
32 import org.junit.Assert;
33 import org.junit.Test;
53 final ArchetypeType archetypeType1 =
new ArchetypeType(
"name1", 1,
"",
true, null,
false,
"description",
"use", typeAttributes);
54 Assert.assertEquals(
"name1 (1)", archetypeType1.
getDisplayName(archetype));
69 final ArchetypeType archetypeType2 =
new ArchetypeType(
"name2", 1,
"a=${a}${a}",
true, null,
false,
"description",
"use", typeAttributes);
70 Assert.assertEquals(
"name2 (1) [a=]", archetypeType2.
getDisplayName(archetype));
73 Assert.assertEquals(
"name2 (1) [a=xyzxyz]", archetypeType2.
getDisplayName(archetype));
76 Assert.assertEquals(
"name2 (1) [a=${a}${a}]", archetypeType2.
getDisplayName(archetype));
79 final ArchetypeType archetypeType3 =
new ArchetypeType(
"name", 1,
"${}",
true, null,
false,
"description",
"use", typeAttributes);
80 Assert.assertEquals(
"name (1) []", archetypeType3.
getDisplayName(archetype));
82 final ArchetypeType archetypeType4 =
new ArchetypeType(
"name", 1,
"${a",
true, null,
false,
"description",
"use", typeAttributes);
83 Assert.assertEquals(
"name (1) [${a]", archetypeType4.
getDisplayName(archetype));
98 final ArchetypeType archetypeType2 =
new ArchetypeType(
"name2", 1,
"a=${a?True:False}",
true, null,
false,
"description",
"use", typeAttributes);
99 Assert.assertEquals(
"name2 (1) [a=False]", archetypeType2.
getDisplayName(archetype));
102 Assert.assertEquals(
"name2 (1) [a=True]", archetypeType2.
getDisplayName(archetype));
105 Assert.assertEquals(
"name2 (1) [a=False]", archetypeType2.
getDisplayName(archetype));
108 final ArchetypeType archetypeType3 =
new ArchetypeType(
"name", 1,
"${a?:}",
true, null,
false,
"description",
"use", typeAttributes);
110 Assert.assertEquals(
"name (1) []", archetypeType3.
getDisplayName(archetype));
112 Assert.assertEquals(
"name (1) []", archetypeType3.
getDisplayName(archetype));
115 final ArchetypeType archetypeType4 =
new ArchetypeType(
"name", 1,
"${a?b:c:d}",
true, null,
false,
"description",
"use", typeAttributes);
117 Assert.assertEquals(
"name (1) [c:d]", archetypeType4.
getDisplayName(archetype));
119 Assert.assertEquals(
"name (1) [b]", archetypeType4.
getDisplayName(archetype));
122 final ArchetypeType archetypeType5 =
new ArchetypeType(
"name", 1,
"${?",
true, null,
false,
"description",
"use", typeAttributes);
124 Assert.assertEquals(
"name (1) [${?]", archetypeType5.
getDisplayName(archetype));
126 Assert.assertEquals(
"name (1) [${?]", archetypeType5.
getDisplayName(archetype));
128 final ArchetypeType archetypeType6 =
new ArchetypeType(
"name", 1,
"${a?",
true, null,
false,
"description",
"use", typeAttributes);
130 Assert.assertEquals(
"name (1) [${a?]", archetypeType6.
getDisplayName(archetype));
132 Assert.assertEquals(
"name (1) [${a?]", archetypeType6.
getDisplayName(archetype));
134 final ArchetypeType archetypeType7 =
new ArchetypeType(
"name", 1,
"${a?:",
true, null,
false,
"description",
"use", typeAttributes);
136 Assert.assertEquals(
"name (1) [${a?:]", archetypeType7.
getDisplayName(archetype));
138 Assert.assertEquals(
"name (1) [${a?:]", archetypeType7.
getDisplayName(archetype));
145 @Test(expected = UnsupportedOperationException.class)
150 final Iterator<?> iterator = archetypeType.iterator();
151 Assert.assertTrue(iterator.hasNext());
A FaceObjects for regression tests.
A set of key/value pairs.
A set of ArchetypeAttributeDefinitions.
Gridarta can handle frame information of animations and allow the selection of an animation using a t...
An AnimationObjects for regression tests.
String getDisplayName(@NotNull final Attributes baseObject)
Returns a description of this type.
Contains the data of one Gridarta Object-Type.
void testAttributes3()
Checks that ${xxx?true:false} expansions work correctly.
Base package of all Gridarta classes.
void testAttributes2()
Checks that ${xxx} expansions work correctly.
An Archetype implementation for testing purposes.
A set of ArchetypeAttributes.
AnimationObjects is a container for AnimationObjects.
void add(@NotNull final ArchetypeAttribute archetypeAttribute)
Adds an ArchetypeAttribute.
FaceObjects is a container for FaceObjects.
void setObjectText(@NotNull String objectText)
Sets.
void testIteratorReadOnly()
Checks that ArchetypeType#iterator() returns a read-only iterator.
An ArchetypeAttribute for selecting integer values.
Provider for faces of GameObjects and Archetypes.
The face is the appearance of an object.
Creates ImageIcon instances from resources.
void testAttributes1()
Checks that empty expansions work correctly.
Regression tests for ArchetypeType.