Browse Source

Skip tests of image task on Java 9+

master
Gintas Grigelionis 7 years ago
parent
commit
175192a3ec
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageTest.java

+ 5
- 1
src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageTest.java View File

@@ -21,6 +21,7 @@ package org.apache.tools.ant.taskdefs.optional.image;
import org.apache.tools.ant.AntAssert;
import org.apache.tools.ant.BuildFileRule;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.JavaEnvUtils;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
@@ -29,6 +30,7 @@ import org.junit.Test;
import java.io.File;

import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;


@@ -48,6 +50,8 @@ public class ImageTest {

@Before
public void setUp() {
/* JAI depends on internal API removed in Java 9 */
assumeFalse(JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9));
buildRule.configureProject(TASKDEFS_DIR + "image.xml");
}

@@ -72,7 +76,7 @@ public class ImageTest {
buildRule.executeTarget("testSimpleScale");
AntAssert.assertContains("Processing File", buildRule.getLog());
File f = new File(buildRule.getOutputDir(), LARGEIMAGE);
assumeTrue("Could not change file modificaiton date",
assumeTrue("Could not change file modification date",
f.setLastModified(f.lastModified() - FILE_UTILS.getFileTimestampGranularity() * 2));
long lastModified = f.lastModified();
buildRule.executeTarget("testOverwriteTrue");


Loading…
Cancel
Save