|
jInfer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.cuni.mff.ksi.jinfer.base.utils.TestUtils
public final class TestUtils
A few utilities to be used in JUnit tests.
| Field Summary | |
|---|---|
static List<String> |
EMPTY_CONTEXT
Empty context, can be used in Element construction. |
static Map<String,Object> |
EMPTY_METADATA
Empty metadata, can be used in Element construction. |
| Method Summary | |
|---|---|
static String |
elementToStr(Element e)
Returns a simple textual representation of specified element, fit for using in unit tests. |
static Attribute |
getAttribute(String name)
Returns an attribute with provided name. |
static Element |
getElement(String name)
Returns an element with provided name. |
static Element |
getElement(String name,
Regexp<AbstractStructuralNode> subnodes)
Returns an element with provided name and subnodes. |
static Element |
getElementWithAttribute(String element,
String attribute,
String value)
Returns an element with provided name, containing an attribute with provided name and content. |
static SimpleData |
getSimpleData(String content)
Returns a simple data with provided string as its only content. |
static SimpleData |
getSimpleDataByName(String name)
Returns a simple data with provided string as its name. |
static Regexp<AbstractStructuralNode> |
getToken(AbstractStructuralNode n)
Encapsulates the specified node into a mutable token regexp with interval "once". |
static String |
regexpToStr(Regexp<AbstractStructuralNode> r)
Returns a simple textual representation of specified regexp, fit for using in unit tests. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final List<String> EMPTY_CONTEXT
Element construction.
public static final Map<String,Object> EMPTY_METADATA
Element construction.
| Method Detail |
|---|
public static String elementToStr(Element e)
public static String regexpToStr(Regexp<AbstractStructuralNode> r)
public static Element getElement(String name,
Regexp<AbstractStructuralNode> subnodes)
name - Name for this element.subnodes - Subnodes of this element.
public static Element getElement(String name)
RegexpType.LAMBDA, there are no attributes.
The element will be created as immutable.
name - Name for this element.
public static Element getElementWithAttribute(String element,
String attribute,
String value)
RegexpType.LAMBDA.
The element will be created as immutable.
element - Name for this element.attribute - Name of its only attribute.value - The only value of the attribute.
public static SimpleData getSimpleData(String content)
content - The only content string this simple data should have.
public static SimpleData getSimpleDataByName(String name)
name - The name of simple data.
public static Attribute getAttribute(String name)
name - Name for this attribute.
public static Regexp<AbstractStructuralNode> getToken(AbstractStructuralNode n)
|
jInfer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||