From fad0683b496c9655401d0a414608dd3e42252c05 Mon Sep 17 00:00:00 2001 From: Gintas Grigelionis Date: Sat, 27 Oct 2018 13:03:37 +0200 Subject: [PATCH] Fixed a broken test --- src/etc/testcases/core/dispatch/dispatch.xml | 9 ++++----- .../org/apache/tools/ant/DispatchTaskTest.java | 13 +++++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/etc/testcases/core/dispatch/dispatch.xml b/src/etc/testcases/core/dispatch/dispatch.xml index d529644de..589c6e197 100644 --- a/src/etc/testcases/core/dispatch/dispatch.xml +++ b/src/etc/testcases/core/dispatch/dispatch.xml @@ -19,14 +19,13 @@ - - + + - - + + diff --git a/src/tests/junit/org/apache/tools/ant/DispatchTaskTest.java b/src/tests/junit/org/apache/tools/ant/DispatchTaskTest.java index 4c76dc54b..079e7ecbd 100644 --- a/src/tests/junit/org/apache/tools/ant/DispatchTaskTest.java +++ b/src/tests/junit/org/apache/tools/ant/DispatchTaskTest.java @@ -21,19 +21,28 @@ package org.apache.tools.ant; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; + +import static org.junit.Assert.assertNotNull; public class DispatchTaskTest { @Rule public BuildFileRule buildRule = new BuildFileRule(); + @Rule + public ExpectedException thrown = ExpectedException.none(); + @Before public void setUp() { + assertNotNull("build.tests.value not set", System.getProperty("build.tests.value")); buildRule.configureProject("src/etc/testcases/core/dispatch/dispatch.xml"); } - @Test(expected = BuildException.class) + @Test public void testDisp() { - buildRule.executeTarget("disp"); + thrown.expect(BuildException.class); + thrown.expectMessage("list"); + buildRule.executeTarget("disp"); } }