Class BaseJSTypeTestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.google.javascript.rhino.testing.BaseJSTypeTestCase
- All Implemented Interfaces:
junit.framework.Test
public abstract class BaseJSTypeTestCase
extends junit.framework.TestCase
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
A definition of all extern types.protected JSType
protected FunctionType
protected ObjectType
protected JSType
protected ObjectType
protected JSType
protected ObjectType
protected JSType
protected ObjectType
protected JSType
protected ObjectType
protected TestErrorReporter
protected JSType
protected ObjectType
protected FunctionType
protected FunctionType
protected ObjectType
protected JSType
protected JSType
protected JSType
protected int
protected ObjectType
protected ObjectType
protected ObjectType
protected JSType
protected JSType
protected JSType
protected ObjectType
protected JSType
protected JSType
protected FunctionType
protected JSType
protected JSType
protected JSType
protected ObjectType
protected JSType
protected ObjectType
protected JSType
protected ObjectType
protected JSType
protected ObjectType
protected JSTypeRegistry
protected JSType
protected ObjectType
protected JSType
protected JSType
protected ObjectType
protected JSType
protected ObjectType
protected FunctionType
protected FunctionType
protected ObjectType
protected JSType
protected ObjectType
protected JSType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addNativeProperties
(JSTypeRegistry registry) Adds a basic set of properties to the native types.protected final void
assertTypeEquals
(JSType a, JSType b) protected void
assertTypeEquals
(JSType expected, JSTypeExpression actual) Asserts that a a type expression resolves to the correctJSType
.protected void
assertTypeEquals
(JSType expected, Node actual) Asserts that a Node representing a type expression resolves to the correctJSType
.protected final void
assertTypeEquals
(String msg, JSType a, JSType b) protected final void
assertTypeNotEquals
(JSType a, JSType b) protected final void
assertTypeNotEquals
(String msg, JSType a, JSType b) protected JSType
createNullableType
(JSType type) protected JSType
createOptionalType
(JSType type) protected RecordTypeBuilder
protected TemplatizedType
createTemplatizedType
(ObjectType baseType, com.google.common.collect.ImmutableList<JSType> templatizedTypes) protected TemplatizedType
createTemplatizedType
(ObjectType baseType, JSType... templatizedType) protected JSType
createUnionType
(JSType... variants) protected void
protected JSType
resolve
(JSTypeExpression n, String... warnings) Resolves a type expression, expecting the given warnings.protected void
setUp()
Methods inherited from class junit.framework.TestCase
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, tearDown, toString
-
Field Details
-
registry
-
errorReporter
-
ALL_TYPE
-
NO_OBJECT_TYPE
-
NO_TYPE
-
NO_RESOLVED_TYPE
-
ARRAY_FUNCTION_TYPE
-
ARRAY_TYPE
-
BOOLEAN_OBJECT_FUNCTION_TYPE
-
BOOLEAN_OBJECT_TYPE
-
BOOLEAN_TYPE
-
CHECKED_UNKNOWN_TYPE
-
DATE_FUNCTION_TYPE
-
DATE_TYPE
-
ERROR_FUNCTION_TYPE
-
ERROR_TYPE
-
EVAL_ERROR_FUNCTION_TYPE
-
EVAL_ERROR_TYPE
-
FUNCTION_FUNCTION_TYPE
-
FUNCTION_INSTANCE_TYPE
-
FUNCTION_PROTOTYPE
-
GREATEST_FUNCTION_TYPE
-
LEAST_FUNCTION_TYPE
-
MATH_TYPE
-
NULL_TYPE
-
NUMBER_OBJECT_FUNCTION_TYPE
-
NUMBER_OBJECT_TYPE
-
NUMBER_STRING_BOOLEAN
-
NUMBER_TYPE
-
OBJECT_FUNCTION_TYPE
-
NULL_VOID
-
OBJECT_NUMBER_STRING
-
OBJECT_NUMBER_STRING_BOOLEAN
-
OBJECT_PROTOTYPE
-
OBJECT_TYPE
-
RANGE_ERROR_FUNCTION_TYPE
-
RANGE_ERROR_TYPE
-
REFERENCE_ERROR_FUNCTION_TYPE
-
REFERENCE_ERROR_TYPE
-
REGEXP_FUNCTION_TYPE
-
REGEXP_TYPE
-
STRING_OBJECT_FUNCTION_TYPE
-
STRING_OBJECT_TYPE
-
STRING_TYPE
-
SYNTAX_ERROR_FUNCTION_TYPE
-
SYNTAX_ERROR_TYPE
-
TYPE_ERROR_FUNCTION_TYPE
-
TYPE_ERROR_TYPE
-
U2U_CONSTRUCTOR_TYPE
-
U2U_FUNCTION_TYPE
-
UNKNOWN_TYPE
-
URI_ERROR_FUNCTION_TYPE
-
URI_ERROR_TYPE
-
VOID_TYPE
-
NATIVE_PROPERTIES_COUNT
protected int NATIVE_PROPERTIES_COUNT -
ALL_NATIVE_EXTERN_TYPES
A definition of all extern types. This should be kept in sync with javascript/externs/es3.js. This is used to check that the built-in types declared inJSTypeRegistry
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.- See Also:
-
-
Constructor Details
-
BaseJSTypeTestCase
public BaseJSTypeTestCase()
-
-
Method Details
-
setUp
- Overrides:
setUp
in classjunit.framework.TestCase
- Throws:
Exception
-
initTypes
protected void initTypes() -
addNativeProperties
Adds a basic set of properties to the native types. -
createUnionType
-
createRecordTypeBuilder
-
createNullableType
-
createOptionalType
-
createTemplatizedType
protected TemplatizedType createTemplatizedType(ObjectType baseType, com.google.common.collect.ImmutableList<JSType> templatizedTypes) -
createTemplatizedType
-
assertTypeEquals
Asserts that a Node representing a type expression resolves to the correctJSType
. -
assertTypeEquals
Asserts that a a type expression resolves to the correctJSType
. -
resolve
Resolves a type expression, expecting the given warnings. -
assertTypeEquals
-
assertTypeEquals
-
assertTypeNotEquals
-
assertTypeNotEquals
-