Package org.jboss.weld.test.util
Class ActionSequence
- java.lang.Object
-
- org.jboss.weld.test.util.ActionSequence
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classActionSequence.TransformationUtils
-
Constructor Summary
Constructors Constructor Description ActionSequence()ActionSequence(String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ActionSequenceadd(String actionId)static booleanaddAction(String actionId)Add actionId to default sequence.static booleanaddAction(String sequenceName, String actionId)Add actionId to specified sequence.voidassertDataContainsAll(Class<?>... expected)Assert that this sequence contains simple class names of all of theexpectedclasses.voidassertDataContainsAll(String... expected)Assert that this sequence contains all of theexpectedstrings.voidassertDataContainsAll(Collection<String> expected)Assert that this sequence contains all of theexpectedstrings.voidassertDataEquals(Class<?>... expected)Assert that strings stored in this sequence equal (in order!) to the simple class names of theexpectedclasses.voidassertDataEquals(String... expected)Assert that strings stored in this sequence equal (in order!) to theexpectedstrings.voidassertDataEquals(List<String> expected)Assert that strings stored in this sequence equal (in order!) to theexpectedstrings.static voidassertSequenceDataContainsAll(Class<?>... expected)Assert that the default sequence contains simple class names of all of theexpectedclasses.static voidassertSequenceDataContainsAll(String... expected)Assert that this sequence contains all of theexpectedstrings.static voidassertSequenceDataContainsAll(Collection<String> expected)Assert that this sequence contains all of theexpectedstrings.static voidassertSequenceDataEquals(Class<?>... expected)Assert that strings stored in the default sequence equal (in order!) to the simple class names ofexpected.static voidassertSequenceDataEquals(String... expected)Assert that strings stored in this sequence equal (in order!) to theexpectedstrings.static voidassertSequenceDataEquals(List<String> expected)Assert that strings stored in this sequence equal (in order!) to theexpectedstrings.booleanbeginsWith(String... actions)static ActionSequencebuildFromCsvData(String csv)booleancontainsAll(String... actions)StringdataToCsv()booleanendsWith(String... actions)List<String>getData()StringgetName()static ActionSequencegetSequence()static ActionSequencegetSequence(String sequenceName)static List<String>getSequenceData()static List<String>getSequenceData(String sequenceName)static intgetSequenceSize()static intgetSequenceSize(String sequenceName)static voidreset()Remove all sequences.StringtoString()
-
-
-
Constructor Detail
-
ActionSequence
public ActionSequence()
-
ActionSequence
public ActionSequence(String name)
- Parameters:
name-
-
-
Method Detail
-
add
public ActionSequence add(String actionId)
- Parameters:
actionId-- Returns:
- data holder
-
getName
public String getName()
- Returns:
- name of sequence
-
containsAll
public boolean containsAll(String... actions)
- Parameters:
actions-- Returns:
trueif sequence data contain all of the specified actions,falseotherwise
-
beginsWith
public boolean beginsWith(String... actions)
- Parameters:
actions-- Returns:
trueif sequence data begins with the specified actions,falseotherwise
-
endsWith
public boolean endsWith(String... actions)
- Parameters:
actions-- Returns:
trueif sequence data ends with the specified actions,falseotherwise
-
dataToCsv
public String dataToCsv()
- Returns:
- data in simple CSV format
-
assertDataEquals
public void assertDataEquals(List<String> expected)
Assert that strings stored in this sequence equal (in order!) to theexpectedstrings.- Parameters:
expected-
-
assertDataEquals
public void assertDataEquals(String... expected)
Assert that strings stored in this sequence equal (in order!) to theexpectedstrings.- Parameters:
expected-
-
assertDataEquals
public void assertDataEquals(Class<?>... expected)
Assert that strings stored in this sequence equal (in order!) to the simple class names of theexpectedclasses.- Parameters:
expected-
-
assertDataContainsAll
public void assertDataContainsAll(Collection<String> expected)
Assert that this sequence contains all of theexpectedstrings. Note that this only verifies that theexpectedstrings are a SUBSET of the actual strings stored in this sequence.- Parameters:
expected-
-
assertDataContainsAll
public void assertDataContainsAll(String... expected)
Assert that this sequence contains all of theexpectedstrings. Note that this only verifies that theexpectedstrings are a SUBSET of the actual strings stored in this sequence.- Parameters:
expected-
-
assertDataContainsAll
public void assertDataContainsAll(Class<?>... expected)
Assert that this sequence contains simple class names of all of theexpectedclasses. Note that this only verifies that theexpectedclasses are a SUBSET of the actual classes stored in this sequence.- Parameters:
expected-
-
reset
public static void reset()
Remove all sequences.
-
addAction
public static boolean addAction(String sequenceName, String actionId)
Add actionId to specified sequence. Add new sequence if needed.- Parameters:
sequence-actionId-- Returns:
trueif a new sequence was added,falseotherwise
-
addAction
public static boolean addAction(String actionId)
Add actionId to default sequence.- Parameters:
actionId-- Returns:
trueif a new sequence was added,falseotherwise
-
getSequence
public static ActionSequence getSequence()
- Returns:
- default sequence or
nullif no such sequence exists
-
getSequence
public static ActionSequence getSequence(String sequenceName)
- Parameters:
name-- Returns:
- specified sequence or
nullif no such sequence exists
-
getSequenceData
public static List<String> getSequenceData()
- Returns:
- data of default sequence or
nullif no such sequence exists
-
getSequenceData
public static List<String> getSequenceData(String sequenceName)
- Parameters:
sequenceName-- Returns:
- data of specified sequence or
nullif no such sequence exists
-
getSequenceSize
public static int getSequenceSize()
- Returns:
- size of default sequence
-
getSequenceSize
public static int getSequenceSize(String sequenceName)
- Parameters:
sequence-- Returns:
- size of specified sequence
-
buildFromCsvData
public static ActionSequence buildFromCsvData(String csv)
- Parameters:
csv-- Returns:
-
assertSequenceDataEquals
public static void assertSequenceDataEquals(List<String> expected)
Assert that strings stored in this sequence equal (in order!) to theexpectedstrings.- Parameters:
expected-- Throws:
IllegalStateException- if there is no default sequence
-
assertSequenceDataEquals
public static void assertSequenceDataEquals(String... expected)
Assert that strings stored in this sequence equal (in order!) to theexpectedstrings.- Parameters:
expected-- Throws:
IllegalStateException- if there is no default sequence
-
assertSequenceDataEquals
public static void assertSequenceDataEquals(Class<?>... expected)
Assert that strings stored in the default sequence equal (in order!) to the simple class names ofexpected.- Parameters:
expected-- Throws:
IllegalStateException- if there is no default sequence
-
assertSequenceDataContainsAll
public static void assertSequenceDataContainsAll(Collection<String> expected)
Assert that this sequence contains all of theexpectedstrings. Note that this only verifies that theexpectedstrings are a SUBSET of the actual strings stored in this sequence.- Parameters:
expected-- Throws:
IllegalStateException- if there is no default sequence
-
assertSequenceDataContainsAll
public static void assertSequenceDataContainsAll(String... expected)
Assert that this sequence contains all of theexpectedstrings. Note that this only verifies that theexpectedstrings are a SUBSET of the actual strings stored in this sequence.- Parameters:
expected-- Throws:
IllegalStateException- if there is no default sequence
-
assertSequenceDataContainsAll
public static void assertSequenceDataContainsAll(Class<?>... expected)
Assert that the default sequence contains simple class names of all of theexpectedclasses. Note that this only verifies that theexpectedclasses are a SUBSET of the actual classes stored in this sequence.- Parameters:
expected-- Throws:
IllegalStateException- if there is no default sequence
-
-