net.sf.gridarta.model.baseobject
public class AbstractBaseObjectTest extends Object
AbstractBaseObject
.Modifier and Type | Field and Description |
---|---|
private ResourceIcons |
resourceIcons
The
ResourceIcons instance. |
Constructor and Description |
---|
AbstractBaseObjectTest() |
Modifier and Type | Method and Description |
---|---|
private static void |
checkDirection(BaseObject<?,?,?,?> gameObject,
int direction)
Checks that the "direction" attribute of a
GameObject contains
the expected value. |
private static void |
checkName(BaseObject<?,?,?,?> gameObject,
String name,
String nameAttribute)
Checks that the
BaseObject.NAME attribute of an GameObject contains the expected value. |
private static void |
checkType(BaseObject<?,?,?,?> gameObject,
int type)
Checks that the
BaseObject.TYPE attribute of a GameObject
contains the expected value. |
private static TestArchetype |
newArchetype(String archetypeName,
String objectText,
FaceObjectProviders faceObjectProviders,
AnimationObjects animationObjects)
Creates a new
TestArchetype instance. |
private FaceObjectProviders |
newFaceObjectProviders()
Creates a new
FaceObjectProviders instance. |
private static GameObject<TestGameObject,TestMapArchObject,TestArchetype> |
newGameObject(TestArchetype archetype,
String name,
FaceObjectProviders faceObjectProviders,
AnimationObjects animationObjects)
Creates a new game object instance.
|
void |
testDirection1()
Checks that caching the "direction" attribute does work.
|
void |
testDirection2()
Checks that caching the "direction" attribute does work.
|
void |
testDirection3()
Checks that caching the "direction" attribute does work.
|
void |
testName1()
Checks that caching the "name" attribute does work.
|
void |
testName2()
Checks that caching the "name" attribute does work.
|
void |
testName3()
Checks that caching the "name" attribute does work.
|
void |
testSetAttributeInt1()
Checks that
AbstractBaseObject.setAttributeInt(String, int) works
as expected. |
void |
testSetAttributeString()
Checks that
BaseObject.setAttributeString(String, String) does
work. |
void |
testSetFaceName1()
Checks that setting the face name does work.
|
void |
testSetFaceName2()
Checks that a custom face may be changed.
|
void |
testSetObjectTextAttributeOrdering()
Checks that
BaseObject.setObjectText(String) ignores attribute
ordering. |
void |
testToString1()
Checks that
AbstractBaseObject.toString(String) works as
expected. |
void |
testType1()
Checks that caching the "type" attribute does work.
|
void |
testType2()
Checks that caching the "type" attribute does work.
|
void |
testType3()
Checks that caching the "type" attribute does work.
|
@NotNull private final ResourceIcons resourceIcons
ResourceIcons
instance.public AbstractBaseObjectTest()
public void testSetFaceName1()
public void testSetFaceName2()
public void testSetAttributeString()
BaseObject.setAttributeString(String, String)
does
work.public void testDirection1()
public void testDirection2()
public void testDirection3()
private static void checkDirection(@NotNull BaseObject<?,?,?,?> gameObject, int direction)
GameObject
contains
the expected value.gameObject
- the game object to checkdirection
- the expected directionpublic void testType1()
public void testType2()
public void testType3()
private static void checkType(@NotNull BaseObject<?,?,?,?> gameObject, int type)
BaseObject.TYPE
attribute of a GameObject
contains the expected value.gameObject
- the game object to checktype
- the expected directionpublic void testName1()
public void testName2()
public void testName3()
public void testSetAttributeInt1()
AbstractBaseObject.setAttributeInt(String, int)
works
as expected.public void testToString1()
AbstractBaseObject.toString(String)
works as
expected.public void testSetObjectTextAttributeOrdering()
BaseObject.setObjectText(String)
ignores attribute
ordering.private static void checkName(@NotNull BaseObject<?,?,?,?> gameObject, @NotNull String name, @NotNull String nameAttribute)
BaseObject.NAME
attribute of an GameObject
contains the expected value.gameObject
- the game object to checkname
- the expected name (cached value)nameAttribute
- the expected name ("name" attribute)@NotNull private static TestArchetype newArchetype(@NotNull String archetypeName, @Nullable String objectText, @NotNull FaceObjectProviders faceObjectProviders, @NotNull AnimationObjects animationObjects)
TestArchetype
instance.archetypeName
- the archetype nameobjectText
- the object text to add or null
faceObjectProviders
- the face object providers for looking up
facesanimationObjects
- the animation objects for looking up animations@NotNull private static GameObject<TestGameObject,TestMapArchObject,TestArchetype> newGameObject(@NotNull TestArchetype archetype, @NotNull String name, @NotNull FaceObjectProviders faceObjectProviders, @NotNull AnimationObjects animationObjects)
archetype
- the archetype to create the game object fromname
- the game object's namefaceObjectProviders
- the face object providers for looking up
facesanimationObjects
- the animation objects for looking up animationsprivate FaceObjectProviders newFaceObjectProviders()
FaceObjectProviders
instance.Feedback: webmaster
© 2003-2010 The Gridarta Developers. All rights reserved.