Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Side by Side Diff: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/JUnitSemanticProcessor.java

Issue 244183002: Add ClassDeclaration/ClassTypeAlias.isAbstract() and use them. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: forgotten class Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/LightNodeElements.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698