Skip to content

Commit

Permalink
tests: Convert String to TextBlock
Browse files Browse the repository at this point in the history
automated Cleanup
  • Loading branch information
EcljpseB0T authored and jukzi committed May 17, 2024
1 parent eddfb7d commit c64c3d7
Show file tree
Hide file tree
Showing 509 changed files with 539,746 additions and 470,859 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ public void testFinalRound() throws Throwable {
// first runs; but on its final round it then generates a new Java type
// that is annotated with @FinalRoundTestTrigger.
env.addClass(root, "t", "Foo",
"package t;\n" +
"import org.eclipse.jdt.apt.pluggable.tests.annotations.FinalRoundTestTrigger;\n" +
"@FinalRoundTestTrigger\n" +
"public class Foo {}"
"""
package t;
import org.eclipse.jdt.apt.pluggable.tests.annotations.FinalRoundTestTrigger;
@FinalRoundTestTrigger
public class Foo {}"""
);
AptConfig.setEnabled(jproj, true);

Expand All @@ -104,9 +105,10 @@ public void disabled_testInheritedAnnotation() throws Throwable {
IPath root = projPath.append("src");

env.addClass(root, "", "Base",
"import org.eclipse.jdt.apt.pluggable.tests.annotations.InheritedTrigger;\n" +
"@InheritedTrigger(0)\n" +
"public class Base {}"
"""
import org.eclipse.jdt.apt.pluggable.tests.annotations.InheritedTrigger;
@InheritedTrigger(0)
public class Base {}"""
);

// Because Sub extends Base, it should be treated as if it were annotated with InheritedTrigger
Expand All @@ -128,9 +130,10 @@ public void disabled_testInheritedAnnotation() throws Throwable {
// Modify base class and verify that both base and subclass get processed
InheritedAnnoProc.clearProcessedElements();
env.addClass(root, "", "Base",
"import org.eclipse.jdt.apt.pluggable.tests.annotations.InheritedTrigger;\n" +
"@InheritedTrigger(1)\n" +
"public class Base {}"
"""
import org.eclipse.jdt.apt.pluggable.tests.annotations.InheritedTrigger;
@InheritedTrigger(1)
public class Base {}"""
);
incrementalBuild();
expectingNoProblems();
Expand All @@ -143,9 +146,10 @@ public void disabled_testInheritedAnnotation() throws Throwable {
// Modify subclass and verify that it gets processed
InheritedAnnoProc.clearProcessedElements();
env.addClass(root, "", "Sub",
"public class Sub extends Base {\n" +
" // this line is new\n" +
"}"
"""
public class Sub extends Base {
// this line is new
}"""
);
incrementalBuild();
expectingNoProblems();
Expand All @@ -171,22 +175,26 @@ public void testBug295948() throws Throwable {
IPath root = projPath.append("src");

env.addClass(root, "test295948", "FooEvent",
"package test295948;\n" +
"public class FooEvent {\n" +
" public interface Handler {\n" +
" void handle(FooEvent event);\n" +
" }\n" +
"}\n" +
"\n"
"""
package test295948;
public class FooEvent {
public interface Handler {
void handle(FooEvent event);
}
}
"""
);

IPath fooImplClass = env.addClass(root, "test295948", "FooImpl",
"package test295948;\n" +
"public class FooImpl implements FooEvent.Handler {\n" +
" @Override\n" +
" public void handle(FooEvent event) {\n" +
" }\n" +
"}\n"
"""
package test295948;
public class FooImpl implements FooEvent.Handler {
@Override
public void handle(FooEvent event) {
}
}
"""
);

AptConfig.setEnabled(jproj, true);
Expand Down Expand Up @@ -283,19 +291,21 @@ public void testBatchedBuild() throws Throwable {
ProcessorTestStatus.reset();

env.addClass(root, "test", "Foo",
"package test;\n" +
"import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;\n" +
"@GenClass6(name = \"FooGen\", pkg = \"test\")\n" +
"public class Foo {\n" +
" public Bar bar;\n" +
"}");
"""
package test;
import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;
@GenClass6(name = "FooGen", pkg = "test")
public class Foo {
public Bar bar;
}""");
env.addClass(root, "test", "Bar",
"package test;\n" +
"import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;\n" +
"@GenClass6(name = \"BarGen\", pkg = \"test\")\n" +
"public class Bar {\n" +
" public Foo foo;\n" +
"}");
"""
package test;
import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;
@GenClass6(name = "BarGen", pkg = "test")
public class Bar {
public Foo foo;
}""");
AptConfig.setEnabled(jproj, true);

fullBuild();
Expand Down Expand Up @@ -327,20 +337,22 @@ public void testBug468853() throws Throwable {
ProcessorTestStatus.reset();

env.addClass(root, "test", "Foo",
"package test;\n" +
"import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;\n" +
"import org.eclipse.jdt.apt.pluggable.tests.annotations.Message6;\n" +
"import javax.tools.Diagnostic.Kind;\n" +
"@GenClass6(name = \"FooGen\", pkg = \"test\", rounds = 2)\n" +
"@Message6(text = \"APT message\", value = Kind.ERROR)\n" +
"public class Foo extends FooGen {\n" +
" public Bar bar;\n" +
"}");
"""
package test;
import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;
import org.eclipse.jdt.apt.pluggable.tests.annotations.Message6;
import javax.tools.Diagnostic.Kind;
@GenClass6(name = "FooGen", pkg = "test", rounds = 2)
@Message6(text = "APT message", value = Kind.ERROR)
public class Foo extends FooGen {
public Bar bar;
}""");
env.addClass(root, "test", "Bar",
"package test;\n" +
"public class Bar {\n" +
" public Foo foo;\n" +
"}");
"""
package test;
public class Bar {
public Foo foo;
}""");
AptConfig.setEnabled(jproj, true);

fullBuild();
Expand Down Expand Up @@ -405,12 +417,13 @@ public void testBug539663() throws Throwable {
env.addClass(root, null, "module-info", "module example {requires annotations;}");

env.addClass(root, "test", "Foo",
"package test;\n" +
"import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;\n" +
"@GenClass6(name = \"ImmutableFoo\", pkg = \"test\")\n" +
"public class Foo {\n" +
" public void f(ImmutableFoo o) { }\n" +
"}");
"""
package test;
import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;
@GenClass6(name = "ImmutableFoo", pkg = "test")
public class Foo {
public void f(ImmutableFoo o) { }
}""");
AptConfig.setEnabled(jproj, true);

fullBuild();
Expand Down
Loading

0 comments on commit c64c3d7

Please sign in to comment.