diff --git a/WHATSNEW b/WHATSNEW index a7494f031..d339ff6e1 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -25,6 +25,10 @@ Fixed bugs: * Ant 1.8 exec task changes have slowed exec to a crawl Bugzilla Report 54128. + * Apt is not available under JDK 1.8 + Bugzilla Report 55922. + + Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/Apt.java b/src/main/org/apache/tools/ant/taskdefs/Apt.java index d49ee47e4..3f91af21d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Apt.java +++ b/src/main/org/apache/tools/ant/taskdefs/Apt.java @@ -262,6 +262,9 @@ public class Apt */ public void execute() throws BuildException { + if (JavaEnvUtils.getJavaVersionNumber() >= 18) { + throw new BuildException("apt does not exist under Java 1.8 and higher"); + } super.execute(); } } diff --git a/src/etc/testcases/taskdefs/apt.xml b/src/tests/antunit/taskdefs/apt-test.xml similarity index 70% rename from src/etc/testcases/taskdefs/apt.xml rename to src/tests/antunit/taskdefs/apt-test.xml index 6f59bf036..9b2400111 100644 --- a/src/etc/testcases/taskdefs/apt.xml +++ b/src/tests/antunit/taskdefs/apt-test.xml @@ -15,7 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. --> - + + @@ -39,21 +40,29 @@ + + + + + + + + - + - + - + - + - + + + - + + + - + + - + + + + + + + + + \ No newline at end of file diff --git a/src/etc/testcases/taskdefs/apt/AptExample.java b/src/tests/antunit/taskdefs/apt/AptExample.java similarity index 100% rename from src/etc/testcases/taskdefs/apt/AptExample.java rename to src/tests/antunit/taskdefs/apt/AptExample.java diff --git a/src/etc/testcases/taskdefs/apt/Distributed.java b/src/tests/antunit/taskdefs/apt/Distributed.java similarity index 100% rename from src/etc/testcases/taskdefs/apt/Distributed.java rename to src/tests/antunit/taskdefs/apt/Distributed.java diff --git a/src/etc/testcases/taskdefs/apt/DistributedAnnotationFactory.java b/src/tests/antunit/taskdefs/apt/DistributedAnnotationFactory.java similarity index 100% rename from src/etc/testcases/taskdefs/apt/DistributedAnnotationFactory.java rename to src/tests/antunit/taskdefs/apt/DistributedAnnotationFactory.java diff --git a/src/etc/testcases/taskdefs/apt/DistributedAnnotationProcessor.java b/src/tests/antunit/taskdefs/apt/DistributedAnnotationProcessor.java similarity index 100% rename from src/etc/testcases/taskdefs/apt/DistributedAnnotationProcessor.java rename to src/tests/antunit/taskdefs/apt/DistributedAnnotationProcessor.java diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/AptTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/AptTest.java deleted file mode 100644 index e7a65db88..000000000 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/AptTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - package org.apache.tools.ant.taskdefs; - -import org.apache.tools.ant.BuildFileTest; - -/** - */ -public class AptTest extends BuildFileTest { - public AptTest(String name) { - super(name); - } - - public void setUp() { - configureProject("src/etc/testcases/taskdefs/apt.xml"); - } - - /** - * Tears down the fixture, for example, close a network connection. This - * method is called after a test is executed. - */ - protected void tearDown() throws Exception { - executeTarget("clean"); - } - - public void testApt() { - executeTarget("testApt"); - } - - public void testAptFork() { - executeTarget("testAptFork"); - } - - public void testAptForkFalse() { - executeTarget("testAptForkFalse"); - assertLogContaining(Apt.WARNING_IGNORING_FORK); - } - - public void testListAnnotationTypes() { - executeTarget("testListAnnotationTypes"); - assertLogContaining("Set of annotations found:"); - assertLogContaining("Distributed"); - } - - public void testAptNewFactory() { - executeTarget("testAptNewFactory"); - assertProcessed(); - } - - public void testAptNewFactoryFork() { - executeTarget("testAptNewFactoryFork"); - assertProcessed(); - } - - private void assertProcessed() { - assertLogContaining("DistributedAnnotationProcessor-is-go"); - assertLogContaining("[-Abuild.dir="); - assertLogContaining("visiting DistributedAnnotationFactory"); - } -} -