Skip to content

Commit

Permalink
test: update CompilationTest to match latest compiler changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pvojtechovsky authored and monperrus committed Nov 7, 2016
1 parent eab80ae commit 1303ebd
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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
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;
@@ -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
@@ -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<>();
@@ -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<>();
@@ -227,7 +232,7 @@ public CompilationUnit[] getCompilationUnits() {
}

}
*/

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

0 comments on commit 1303ebd

Please sign in to comment.