|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
net.curre.prefcount.test.BaseTestCase
public abstract class BaseTestCase
Object of this class represents a base test case for all unit tests and contains a set of prefcount specific assertions and common utilities.
Created date: Nov 27, 2007
| Field Summary | |
|---|---|
protected static java.lang.String |
SETTINGS_FILE
Test settings file path relative to the root project directory. |
| Constructor Summary | |
|---|---|
BaseTestCase()
|
|
| Method Summary | |
|---|---|
static void |
assertButtonValues(java.lang.String message,
javax.swing.JButton button,
boolean isEnabled,
boolean isSelected)
Asserts that the given JButton is not null, is selected/unselected, and is enabled/disabled according to the passed values. |
static void |
assertMapNotNullValues(java.util.Map map,
java.util.List<java.lang.String> keys)
Asserts that the given map has not null values that for the given keys. |
static void |
assertMapNullValues(java.util.Map map,
java.util.List<java.lang.String> keys)
Asserts that the given map does not have values for the given keys. |
static void |
assertNotBlankAndVisible(java.lang.String message,
javax.swing.JLabel label)
Asserts that given label is not null and it's text field is not blank. |
static void |
assertNotVisible(java.awt.Component component)
Asserts that the given component is not visible. |
static void |
assertNotVisible(java.lang.String message,
java.awt.Component component)
Asserts that the given component is not visible. |
static void |
assertTextBlank(java.lang.String message,
javax.swing.JLabel label)
Asserts that the given label is not null and its text string is blank (null or empty). |
static void |
assertTextNotBlank(java.lang.String message,
javax.swing.JLabel label)
Asserts that the given label is not null and its text string is not blank (not null and not empty). |
static void |
assertValidResource(java.lang.String msg,
java.lang.String key)
Asserts the resource key is not null, not empty, and valid (has corresponding string for all available locales). |
static void |
assertVisible(java.awt.Component component)
Asserts that the given component is visible. |
static void |
assertVisible(java.lang.String message,
java.awt.Component component)
Asserts that the given component is visible. |
protected static net.curre.prefcount.bean.PlayerStatistics |
createPlayerStatHelper(net.curre.prefcount.bean.GameResultBean rBean,
int ind,
java.lang.String name,
java.lang.Integer bullet,
java.lang.Integer mountain,
java.lang.String... vists)
Creates player statistics object and initializes it with the passed data. |
protected void |
deleteTestSettingsFile()
Deletes test settings file. |
protected static void |
setTextFields(java.util.Collection<javax.swing.JTextField> fields,
java.lang.String... text)
Sets all JTextField text fileds with the given value. |
protected static void |
setTextFields(java.awt.Component[] comps,
java.lang.String... text)
Sets all JTextField text fileds with the given value. |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String SETTINGS_FILE
| Constructor Detail |
|---|
public BaseTestCase()
| Method Detail |
|---|
public static void assertValidResource(java.lang.String msg,
java.lang.String key)
msg - Error message.key - Resource key to test.
public static void assertNotBlankAndVisible(java.lang.String message,
javax.swing.JLabel label)
message - Error message to display.label - Label object to test.
public static void assertButtonValues(java.lang.String message,
javax.swing.JButton button,
boolean isEnabled,
boolean isSelected)
message - Message that identifies this button.button - Button to test.isEnabled - True if the button is expected to be enabled; false otherwise.isSelected - True if the button is expected to be selected; false otherwise.
public static void assertMapNullValues(java.util.Map map,
java.util.List<java.lang.String> keys)
map - Map to test.keys - Keys to test against the given map.
public static void assertMapNotNullValues(java.util.Map map,
java.util.List<java.lang.String> keys)
map - Map to test.keys - Keys to test against the given map.
public static void assertVisible(java.lang.String message,
java.awt.Component component)
component - Component to test.message - Error message to display.public static void assertVisible(java.awt.Component component)
component - Component to test.
public static void assertNotVisible(java.lang.String message,
java.awt.Component component)
component - Component to test.message - Error message to display.public static void assertNotVisible(java.awt.Component component)
component - Component to test.
public static void assertTextBlank(java.lang.String message,
javax.swing.JLabel label)
message - Error message to display.label - Label to test.
public static void assertTextNotBlank(java.lang.String message,
javax.swing.JLabel label)
message - Error message to display.label - Label to test.protected void deleteTestSettingsFile()
protected static void setTextFields(java.util.Collection<javax.swing.JTextField> fields,
java.lang.String... text)
fields - Array of text fields.text - Text to set.
protected static void setTextFields(java.awt.Component[] comps,
java.lang.String... text)
comps - Array of components.text - Text to set.
protected static net.curre.prefcount.bean.PlayerStatistics createPlayerStatHelper(net.curre.prefcount.bean.GameResultBean rBean,
int ind,
java.lang.String name,
java.lang.Integer bullet,
java.lang.Integer mountain,
java.lang.String... vists)
rBean - Game result bean to set.ind - Player index.name - Player name.bullet - Player bullet.mountain - Player mountain.vists - Vists against other players.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||