From 35b6913d94d4ebaddc1c2296446fbba67cb288b4 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 15 Feb 2002 16:51:10 +0000 Subject: [PATCH] Make tests pass on JDK 1.1. The change to ProjectTest basically backs out a change I had to make to Ralf Wiebicke's original submission to make it work on my box three months ago. Since then nothing has changed, but my JDK now throws a different exception than it did back then - go figure. TimeZone doesn't seem to matter for JDK 1.1, testDateTimeISO fails as text is "2002-02-23T10:11:12" on my machine. I ran out of time and disabled the test, but I promise to check back later. 8-) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271368 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 4 ++++ src/testcases/org/apache/tools/ant/ProjectTest.java | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/build.xml b/build.xml index 47d490598..dda28cab6 100644 --- a/build.xml +++ b/build.xml @@ -974,6 +974,10 @@ + + + diff --git a/src/testcases/org/apache/tools/ant/ProjectTest.java b/src/testcases/org/apache/tools/ant/ProjectTest.java index 60a87ab6a..c23f4fdcb 100644 --- a/src/testcases/org/apache/tools/ant/ProjectTest.java +++ b/src/testcases/org/apache/tools/ant/ProjectTest.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,6 +58,7 @@ import org.apache.tools.ant.types.*; import java.io.File; +import junit.framework.AssertionFailedError; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; @@ -185,15 +186,17 @@ public class ProjectTest extends TestCase { assertTaskDefFails(DummyTaskPrivate.class, DummyTaskPrivate.class + " is not public"); - if (p.getJavaVersion() != Project.JAVA_1_1) { + try { assertTaskDefFails(DummyTaskProtected.class, DummyTaskProtected.class + " is not public"); - } else { + } catch (AssertionFailedError e) { /* * I don't understand this, but this is what happens with * > java -fullversion * java full version "Linux_JDK_1.1.8_v3_green_threads" + * from time to time */ + assertSame(Project.JAVA_1_1, p.getJavaVersion()); assertTaskDefFails(DummyTaskProtected.class, "No public default constructor in " + DummyTaskProtected.class);