| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.element_test; | 8 library engine.element_test; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/java_core.dart'; | 10 import 'package:analyzer/src/generated/java_core.dart'; |
| (...skipping 2930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2941 JUnitTestCase.assertTrue(classA.hasNonFinalField); | 2941 JUnitTestCase.assertTrue(classA.hasNonFinalField); |
| 2942 } | 2942 } |
| 2943 | 2943 |
| 2944 void test_hasNonFinalField_true_inherited() { | 2944 void test_hasNonFinalField_true_inherited() { |
| 2945 ClassElementImpl classA = ElementFactory.classElement2("A", []); | 2945 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2946 ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []); | 2946 ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []); |
| 2947 classA.fields = <FieldElement> [ElementFactory.fieldElement("f", false, fals
e, false, classA.type)]; | 2947 classA.fields = <FieldElement> [ElementFactory.fieldElement("f", false, fals
e, false, classA.type)]; |
| 2948 JUnitTestCase.assertTrue(classB.hasNonFinalField); | 2948 JUnitTestCase.assertTrue(classB.hasNonFinalField); |
| 2949 } | 2949 } |
| 2950 | 2950 |
| 2951 void test_hasStaticMember_false_empty() { |
| 2952 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2953 // no members |
| 2954 JUnitTestCase.assertFalse(classA.hasStaticMember); |
| 2955 } |
| 2956 |
| 2957 void test_hasStaticMember_false_instanceMethod() { |
| 2958 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2959 MethodElement method = ElementFactory.methodElement("foo", null, []); |
| 2960 classA.methods = <MethodElement> [method]; |
| 2961 JUnitTestCase.assertFalse(classA.hasStaticMember); |
| 2962 } |
| 2963 |
| 2964 void test_hasStaticMember_instanceGetter() { |
| 2965 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2966 PropertyAccessorElement getter = ElementFactory.getterElement("foo", false,
null); |
| 2967 classA.accessors = <PropertyAccessorElement> [getter]; |
| 2968 JUnitTestCase.assertFalse(classA.hasStaticMember); |
| 2969 } |
| 2970 |
| 2971 void test_hasStaticMember_true_getter() { |
| 2972 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2973 PropertyAccessorElementImpl getter = ElementFactory.getterElement("foo", fal
se, null); |
| 2974 classA.accessors = <PropertyAccessorElement> [getter]; |
| 2975 // "foo" is static |
| 2976 getter.static = true; |
| 2977 JUnitTestCase.assertTrue(classA.hasStaticMember); |
| 2978 } |
| 2979 |
| 2980 void test_hasStaticMember_true_method() { |
| 2981 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2982 MethodElementImpl method = ElementFactory.methodElement("foo", null, []); |
| 2983 classA.methods = <MethodElement> [method]; |
| 2984 // "foo" is static |
| 2985 method.static = true; |
| 2986 JUnitTestCase.assertTrue(classA.hasStaticMember); |
| 2987 } |
| 2988 |
| 2989 void test_hasStaticMember_true_setter() { |
| 2990 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2991 PropertyAccessorElementImpl setter = ElementFactory.setterElement("foo", fal
se, null); |
| 2992 classA.accessors = <PropertyAccessorElement> [setter]; |
| 2993 // "foo" is static |
| 2994 setter.static = true; |
| 2995 JUnitTestCase.assertTrue(classA.hasStaticMember); |
| 2996 } |
| 2997 |
| 2951 void test_lookUpGetter_declared() { | 2998 void test_lookUpGetter_declared() { |
| 2952 LibraryElementImpl library = ElementFactory.library(createAnalysisContext(),
"lib"); | 2999 LibraryElementImpl library = ElementFactory.library(createAnalysisContext(),
"lib"); |
| 2953 ClassElementImpl classA = ElementFactory.classElement2("A", []); | 3000 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2954 String getterName = "g"; | 3001 String getterName = "g"; |
| 2955 PropertyAccessorElement getter = ElementFactory.getterElement(getterName, fa
lse, null); | 3002 PropertyAccessorElement getter = ElementFactory.getterElement(getterName, fa
lse, null); |
| 2956 classA.accessors = <PropertyAccessorElement> [getter]; | 3003 classA.accessors = <PropertyAccessorElement> [getter]; |
| 2957 (library.definingCompilationUnit as CompilationUnitElementImpl).types = <Cla
ssElement> [classA]; | 3004 (library.definingCompilationUnit as CompilationUnitElementImpl).types = <Cla
ssElement> [classA]; |
| 2958 JUnitTestCase.assertSame(getter, classA.lookUpGetter(getterName, library)); | 3005 JUnitTestCase.assertSame(getter, classA.lookUpGetter(getterName, library)); |
| 2959 } | 3006 } |
| 2960 | 3007 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3102 runJUnitTest(__test, __test.test_hasNonFinalField_false_recursive); | 3149 runJUnitTest(__test, __test.test_hasNonFinalField_false_recursive); |
| 3103 }); | 3150 }); |
| 3104 _ut.test('test_hasNonFinalField_true_immediate', () { | 3151 _ut.test('test_hasNonFinalField_true_immediate', () { |
| 3105 final __test = new ClassElementImplTest(); | 3152 final __test = new ClassElementImplTest(); |
| 3106 runJUnitTest(__test, __test.test_hasNonFinalField_true_immediate); | 3153 runJUnitTest(__test, __test.test_hasNonFinalField_true_immediate); |
| 3107 }); | 3154 }); |
| 3108 _ut.test('test_hasNonFinalField_true_inherited', () { | 3155 _ut.test('test_hasNonFinalField_true_inherited', () { |
| 3109 final __test = new ClassElementImplTest(); | 3156 final __test = new ClassElementImplTest(); |
| 3110 runJUnitTest(__test, __test.test_hasNonFinalField_true_inherited); | 3157 runJUnitTest(__test, __test.test_hasNonFinalField_true_inherited); |
| 3111 }); | 3158 }); |
| 3159 _ut.test('test_hasStaticMember_false_empty', () { |
| 3160 final __test = new ClassElementImplTest(); |
| 3161 runJUnitTest(__test, __test.test_hasStaticMember_false_empty); |
| 3162 }); |
| 3163 _ut.test('test_hasStaticMember_false_instanceMethod', () { |
| 3164 final __test = new ClassElementImplTest(); |
| 3165 runJUnitTest(__test, __test.test_hasStaticMember_false_instanceMethod); |
| 3166 }); |
| 3167 _ut.test('test_hasStaticMember_instanceGetter', () { |
| 3168 final __test = new ClassElementImplTest(); |
| 3169 runJUnitTest(__test, __test.test_hasStaticMember_instanceGetter); |
| 3170 }); |
| 3171 _ut.test('test_hasStaticMember_true_getter', () { |
| 3172 final __test = new ClassElementImplTest(); |
| 3173 runJUnitTest(__test, __test.test_hasStaticMember_true_getter); |
| 3174 }); |
| 3175 _ut.test('test_hasStaticMember_true_method', () { |
| 3176 final __test = new ClassElementImplTest(); |
| 3177 runJUnitTest(__test, __test.test_hasStaticMember_true_method); |
| 3178 }); |
| 3179 _ut.test('test_hasStaticMember_true_setter', () { |
| 3180 final __test = new ClassElementImplTest(); |
| 3181 runJUnitTest(__test, __test.test_hasStaticMember_true_setter); |
| 3182 }); |
| 3112 _ut.test('test_lookUpGetter_declared', () { | 3183 _ut.test('test_lookUpGetter_declared', () { |
| 3113 final __test = new ClassElementImplTest(); | 3184 final __test = new ClassElementImplTest(); |
| 3114 runJUnitTest(__test, __test.test_lookUpGetter_declared); | 3185 runJUnitTest(__test, __test.test_lookUpGetter_declared); |
| 3115 }); | 3186 }); |
| 3116 _ut.test('test_lookUpGetter_inherited', () { | 3187 _ut.test('test_lookUpGetter_inherited', () { |
| 3117 final __test = new ClassElementImplTest(); | 3188 final __test = new ClassElementImplTest(); |
| 3118 runJUnitTest(__test, __test.test_lookUpGetter_inherited); | 3189 runJUnitTest(__test, __test.test_lookUpGetter_inherited); |
| 3119 }); | 3190 }); |
| 3120 _ut.test('test_lookUpGetter_undeclared', () { | 3191 _ut.test('test_lookUpGetter_undeclared', () { |
| 3121 final __test = new ClassElementImplTest(); | 3192 final __test = new ClassElementImplTest(); |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3989 InterfaceTypeImplTest.dartSuite(); | 4060 InterfaceTypeImplTest.dartSuite(); |
| 3990 TypeParameterTypeImplTest.dartSuite(); | 4061 TypeParameterTypeImplTest.dartSuite(); |
| 3991 VoidTypeImplTest.dartSuite(); | 4062 VoidTypeImplTest.dartSuite(); |
| 3992 ClassElementImplTest.dartSuite(); | 4063 ClassElementImplTest.dartSuite(); |
| 3993 ElementLocationImplTest.dartSuite(); | 4064 ElementLocationImplTest.dartSuite(); |
| 3994 ElementImplTest.dartSuite(); | 4065 ElementImplTest.dartSuite(); |
| 3995 HtmlElementImplTest.dartSuite(); | 4066 HtmlElementImplTest.dartSuite(); |
| 3996 LibraryElementImplTest.dartSuite(); | 4067 LibraryElementImplTest.dartSuite(); |
| 3997 MultiplyDefinedElementImplTest.dartSuite(); | 4068 MultiplyDefinedElementImplTest.dartSuite(); |
| 3998 } | 4069 } |
| OLD | NEW |