OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 unit.accept(new GeneralizingAstVisitor<Void>() { | 82 unit.accept(new GeneralizingAstVisitor<Void>() { |
83 @Override | 83 @Override |
84 public Void visitClassDeclaration(ClassDeclaration node) { | 84 public Void visitClassDeclaration(ClassDeclaration node) { |
85 ITypeBinding typeBinding = context.getNodeTypeBinding(node); | 85 ITypeBinding typeBinding = context.getNodeTypeBinding(node); |
86 if (JavaUtils.isSubtype(typeBinding, "junit.framework.TestCase")) { | 86 if (JavaUtils.isSubtype(typeBinding, "junit.framework.TestCase")) { |
87 // replace extends clause | 87 // replace extends clause |
88 if (JavaUtils.isTypeNamed(typeBinding.getSuperclass(), "junit.framewor
k.TestCase")) { | 88 if (JavaUtils.isTypeNamed(typeBinding.getSuperclass(), "junit.framewor
k.TestCase")) { |
89 node.setExtendsClause(extendsClause(typeName("JUnitTestCase"))); | 89 node.setExtendsClause(extendsClause(typeName("JUnitTestCase"))); |
90 } | 90 } |
91 // generate "dartSuite" | 91 // generate "dartSuite" |
92 if (node.getAbstractKeyword() == null) { | 92 if (!node.isAbstract()) { |
93 generateDartSuite(node); | 93 generateDartSuite(node); |
94 } | 94 } |
95 } | 95 } |
96 return super.visitClassDeclaration(node); | 96 return super.visitClassDeclaration(node); |
97 } | 97 } |
98 | 98 |
99 @Override | 99 @Override |
100 public Void visitMethodInvocation(MethodInvocation node) { | 100 public Void visitMethodInvocation(MethodInvocation node) { |
101 super.visitMethodInvocation(node); | 101 super.visitMethodInvocation(node); |
102 SimpleIdentifier nameNode = node.getMethodName(); | 102 SimpleIdentifier nameNode = node.getMethodName(); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 formalParameterList(), | 182 formalParameterList(), |
183 blockFunctionBody(expressionStatement(groupInvocation)))); | 183 blockFunctionBody(expressionStatement(groupInvocation)))); |
184 } | 184 } |
185 | 185 |
186 private boolean isJUnitAssertMethod(MethodInvocation node) { | 186 private boolean isJUnitAssertMethod(MethodInvocation node) { |
187 return JavaUtils.isMethodInClass(context.getNodeBinding(node), "junit.fr
amework.Assert"); | 187 return JavaUtils.isMethodInClass(context.getNodeBinding(node), "junit.fr
amework.Assert"); |
188 } | 188 } |
189 }); | 189 }); |
190 } | 190 } |
191 } | 191 } |
OLD | NEW |