public abstract class BaseJSTypeTestCase
extends junit.framework.TestCase
| Constructor and Description |
|---|
BaseJSTypeTestCase() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addNativeProperties(JSTypeRegistry registry)
Adds a basic set of properties to the native types.
|
protected void |
assertTypeEquals(JSType a,
JSType b) |
protected void |
assertTypeEquals(JSType expected,
JSTypeExpression actual)
Asserts that a a type expression resolves to the correct
JSType. |
protected void |
assertTypeEquals(JSType expected,
Node actual)
Asserts that a Node representing a type expression resolves to the
correct
JSType. |
protected void |
assertTypeEquals(String msg,
JSType a,
JSType b) |
protected void |
assertTypeNotEquals(JSType a,
JSType b) |
protected void |
assertTypeNotEquals(String msg,
JSType a,
JSType b) |
protected JSType |
createNullableType(JSType type) |
protected JSType |
createOptionalType(JSType type) |
protected RecordTypeBuilder |
createRecordTypeBuilder() |
protected JSType |
createTemplatizedType(JSType baseType,
com.google.common.collect.ImmutableList<JSType> templatizedTypes) |
protected JSType |
createUnionType(JSType... variants) |
protected void |
initTypes() |
protected ParameterizedType |
parameterize(ObjectType objType,
JSType t) |
protected JSType |
resolve(JSTypeExpression n,
String... warnings)
Resolves a type expression, expecting the given warnings.
|
protected void |
setUp() |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toStringassertEquals, 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, formatprotected JSTypeRegistry registry
protected TestErrorReporter errorReporter
protected JSType ALL_TYPE
protected ObjectType NO_OBJECT_TYPE
protected ObjectType NO_TYPE
protected ObjectType NO_RESOLVED_TYPE
protected FunctionType ARRAY_FUNCTION_TYPE
protected ObjectType ARRAY_TYPE
protected JSType BOOLEAN_OBJECT_FUNCTION_TYPE
protected ObjectType BOOLEAN_OBJECT_TYPE
protected JSType BOOLEAN_TYPE
protected ObjectType CHECKED_UNKNOWN_TYPE
protected JSType DATE_FUNCTION_TYPE
protected ObjectType DATE_TYPE
protected JSType ERROR_FUNCTION_TYPE
protected ObjectType ERROR_TYPE
protected JSType EVAL_ERROR_FUNCTION_TYPE
protected ObjectType EVAL_ERROR_TYPE
protected FunctionType FUNCTION_FUNCTION_TYPE
protected FunctionType FUNCTION_INSTANCE_TYPE
protected ObjectType FUNCTION_PROTOTYPE
protected JSType GREATEST_FUNCTION_TYPE
protected JSType LEAST_FUNCTION_TYPE
protected JSType MATH_TYPE
protected JSType NULL_TYPE
protected JSType NUMBER_OBJECT_FUNCTION_TYPE
protected ObjectType NUMBER_OBJECT_TYPE
protected JSType NUMBER_STRING_BOOLEAN
protected JSType NUMBER_TYPE
protected FunctionType OBJECT_FUNCTION_TYPE
protected JSType NULL_VOID
protected JSType OBJECT_NUMBER_STRING
protected JSType OBJECT_NUMBER_STRING_BOOLEAN
protected JSType OBJECT_PROTOTYPE
protected ObjectType OBJECT_TYPE
protected JSType RANGE_ERROR_FUNCTION_TYPE
protected ObjectType RANGE_ERROR_TYPE
protected JSType REFERENCE_ERROR_FUNCTION_TYPE
protected ObjectType REFERENCE_ERROR_TYPE
protected JSType REGEXP_FUNCTION_TYPE
protected ObjectType REGEXP_TYPE
protected JSType STRING_OBJECT_FUNCTION_TYPE
protected ObjectType STRING_OBJECT_TYPE
protected JSType STRING_TYPE
protected JSType SYNTAX_ERROR_FUNCTION_TYPE
protected ObjectType SYNTAX_ERROR_TYPE
protected JSType TYPE_ERROR_FUNCTION_TYPE
protected ObjectType TYPE_ERROR_TYPE
protected FunctionType U2U_CONSTRUCTOR_TYPE
protected FunctionType U2U_FUNCTION_TYPE
protected ObjectType UNKNOWN_TYPE
protected JSType URI_ERROR_FUNCTION_TYPE
protected ObjectType URI_ERROR_TYPE
protected JSType VOID_TYPE
protected int NATIVE_PROPERTIES_COUNT
public static final String ALL_NATIVE_EXTERN_TYPES
JSTypeRegistry have the same type as that in the
externs. It can also be used for any tests that want to use built-in types
in their externs.protected void setUp()
throws Exception
setUp in class junit.framework.TestCaseExceptionprotected void initTypes()
public static void addNativeProperties(JSTypeRegistry registry)
protected RecordTypeBuilder createRecordTypeBuilder()
protected JSType createTemplatizedType(JSType baseType, com.google.common.collect.ImmutableList<JSType> templatizedTypes)
protected void assertTypeEquals(JSType expected, Node actual)
JSType.protected void assertTypeEquals(JSType expected, JSTypeExpression actual)
JSType.protected JSType resolve(JSTypeExpression n, String... warnings)
protected final ParameterizedType parameterize(ObjectType objType, JSType t)