Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update CompilationTest to match latest compiler changes #940

Merged
merged 1 commit into from
Nov 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class JDTBatchCompiler extends org.eclipse.jdt.internal.compiler.batch.Ma
protected final JDTBasedSpoonCompiler jdtCompiler;
protected CompilationUnit[] compilationUnits;

JDTBatchCompiler(JDTBasedSpoonCompiler jdtCompiler) {
public JDTBatchCompiler(JDTBasedSpoonCompiler jdtCompiler) {
// by default we don't want anything from JDT
// the reports are sent with callbakcs to the reporter
// for debuggging, you may use System.out/err instead
Expand Down
17 changes: 11 additions & 6 deletions src/test/java/spoon/test/compilation/CompilationTest.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
package spoon.test.compilation;

import org.eclipse.jdt.internal.compiler.batch.CompilationUnit;
import org.junit.Assert;
import org.junit.Test;
import spoon.Launcher;
import spoon.compiler.SpoonCompiler;
import spoon.reflect.code.BinaryOperatorKind;
import spoon.reflect.code.CtBinaryOperator;
import spoon.reflect.code.CtBlock;
import spoon.reflect.code.CtReturn;
import spoon.reflect.declaration.CtClass;
import spoon.reflect.declaration.CtMethod;
import spoon.reflect.declaration.CtType;
import spoon.reflect.declaration.ModifierKind;
import spoon.reflect.factory.CodeFactory;
import spoon.reflect.factory.CoreFactory;
import spoon.reflect.factory.Factory;
import spoon.reflect.reference.CtTypeReference;
import spoon.reflect.visitor.CtScanner;
import spoon.reflect.visitor.filter.TypeFilter;
import spoon.support.compiler.jdt.JDTBasedSpoonCompiler;
import spoon.support.compiler.jdt.JDTBatchCompiler;
import spoon.support.reflect.reference.SpoonClassNotFoundException;
import spoon.test.compilation.testclasses.Bar;
import spoon.test.compilation.testclasses.IBar;
Expand Down Expand Up @@ -153,7 +158,7 @@ public void testNewInstance() throws Exception {
}

}
/*

@Test
public void testFilterResourcesFile() throws Exception {
// shows how to filter input java files, for https://github.com/INRIA/spoon/issues/877
Expand All @@ -162,8 +167,8 @@ public void testFilterResourcesFile() throws Exception {
public SpoonCompiler createCompiler() {
return new JDTBasedSpoonCompiler(getFactory()) {
@Override
protected FileCompiler createBatchCompiler(InputType... args) {
return new FileCompiler(this) {
protected JDTBatchCompiler createBatchCompiler() {
return new JDTBatchCompiler(this) {
@Override
public CompilationUnit[] getCompilationUnits() {
List<CompilationUnit> units = new ArrayList<>();
Expand Down Expand Up @@ -200,8 +205,8 @@ public void testFilterResourcesDir() throws Exception {
public SpoonCompiler createCompiler() {
return new JDTBasedSpoonCompiler(getFactory()) {
@Override
protected FileCompiler createBatchCompiler(InputType... args) {
return new FileCompiler(this) {
protected JDTBatchCompiler createBatchCompiler() {
return new JDTBatchCompiler(this) {
@Override
public CompilationUnit[] getCompilationUnits() {
List<CompilationUnit> units = new ArrayList<>();
Expand All @@ -227,7 +232,7 @@ public CompilationUnit[] getCompilationUnits() {
}

}
*/

@Test
public void testPrecompile() {
// without precompile
Expand Down