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
FieldsModifier and TypeFieldDescriptionstatic final StringA definition of all extern types.protected JSTypeprotected FunctionTypeprotected ObjectTypeprotected JSTypeprotected ObjectTypeprotected JSTypeprotected ObjectTypeprotected JSTypeprotected ObjectTypeprotected JSTypeprotected ObjectTypeprotected TestErrorReporterprotected JSTypeprotected ObjectTypeprotected FunctionTypeprotected FunctionTypeprotected ObjectTypeprotected JSTypeprotected JSTypeprotected JSTypeprotected intprotected ObjectTypeprotected ObjectTypeprotected ObjectTypeprotected JSTypeprotected JSTypeprotected JSTypeprotected ObjectTypeprotected JSTypeprotected JSTypeprotected FunctionTypeprotected JSTypeprotected JSTypeprotected JSTypeprotected ObjectTypeprotected JSTypeprotected ObjectTypeprotected JSTypeprotected ObjectTypeprotected JSTypeprotected ObjectTypeprotected JSTypeRegistryprotected JSTypeprotected ObjectTypeprotected JSTypeprotected JSTypeprotected ObjectTypeprotected JSTypeprotected ObjectTypeprotected FunctionTypeprotected FunctionTypeprotected ObjectTypeprotected JSTypeprotected ObjectTypeprotected JSType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddNativeProperties(JSTypeRegistry registry) Adds a basic set of properties to the native types.protected final voidassertTypeEquals(JSType a, JSType b) protected voidassertTypeEquals(JSType expected, JSTypeExpression actual) Asserts that a a type expression resolves to the correctJSType.protected voidassertTypeEquals(JSType expected, Node actual) Asserts that a Node representing a type expression resolves to the correctJSType.protected final voidassertTypeEquals(String msg, JSType a, JSType b) protected final voidassertTypeNotEquals(JSType a, JSType b) protected final voidassertTypeNotEquals(String msg, JSType a, JSType b) protected JSTypecreateNullableType(JSType type) protected JSTypecreateOptionalType(JSType type) protected RecordTypeBuilderprotected TemplatizedTypecreateTemplatizedType(ObjectType baseType, com.google.common.collect.ImmutableList<JSType> templatizedTypes) protected TemplatizedTypecreateTemplatizedType(ObjectType baseType, JSType... templatizedType) protected JSTypecreateUnionType(JSType... variants) protected voidprotected JSTyperesolve(JSTypeExpression n, String... warnings) Resolves a type expression, expecting the given warnings.protected voidsetUp()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 inJSTypeRegistryhave 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:
setUpin 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
-