From 875d44b5176806a00d81773b57d0f927a7a59e8e Mon Sep 17 00:00:00 2001 From: Jan Materne Date: Fri, 13 Oct 2006 15:40:26 +0000 Subject: [PATCH] "Move" test object to inner class. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@463712 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 2 +- .../ant/types/EnumeratedAttributeTest.java | 16 +++++++------ .../EnumeratedAttributeTest_Factory.java | 24 ------------------- 3 files changed, 10 insertions(+), 32 deletions(-) delete mode 100644 src/tests/junit/org/apache/tools/ant/types/EnumeratedAttributeTest_Factory.java diff --git a/build.xml b/build.xml index 897cebea2..4c1ab9526 100644 --- a/build.xml +++ b/build.xml @@ -1697,7 +1697,7 @@ see ${build.junit.reports} / ${antunit.reports} if="junit.batch"> - + diff --git a/src/tests/junit/org/apache/tools/ant/types/EnumeratedAttributeTest.java b/src/tests/junit/org/apache/tools/ant/types/EnumeratedAttributeTest.java index ec1ff6c08..e0751b45b 100644 --- a/src/tests/junit/org/apache/tools/ant/types/EnumeratedAttributeTest.java +++ b/src/tests/junit/org/apache/tools/ant/types/EnumeratedAttributeTest.java @@ -48,14 +48,10 @@ public class EnumeratedAttributeTest extends TestCase { } public void testFactory() { - EnumeratedAttributeTest_Factory ea1 = (EnumeratedAttributeTest_Factory)EnumeratedAttribute.getInstance( - EnumeratedAttributeTest_Factory.class, - "one"); - assertEquals("Factory didnt set the right value.", ea1.getValue(), "one"); + Factory ea = (Factory)EnumeratedAttribute.getInstance(Factory.class, "one"); + assertEquals("Factory did not set the right value.", ea.getValue(), "one"); try { - EnumeratedAttributeTest_Factory ea2 = (EnumeratedAttributeTest_Factory)EnumeratedAttribute.getInstance( - EnumeratedAttributeTest_Factory.class, - "illegal"); + EnumeratedAttribute.getInstance(Factory.class, "illegal"); fail("Factory should fail when trying to set an illegal value."); } catch (BuildException be) { // was expected @@ -96,5 +92,11 @@ public class EnumeratedAttributeTest extends TestCase { return null; } } + + public static class Factory extends EnumeratedAttribute { + public String[] getValues() { + return new String[] { "one", "two", "three" }; + } + } } diff --git a/src/tests/junit/org/apache/tools/ant/types/EnumeratedAttributeTest_Factory.java b/src/tests/junit/org/apache/tools/ant/types/EnumeratedAttributeTest_Factory.java deleted file mode 100644 index 4a5c4bd48..000000000 --- a/src/tests/junit/org/apache/tools/ant/types/EnumeratedAttributeTest_Factory.java +++ /dev/null @@ -1,24 +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.types; - -public class EnumeratedAttributeTest_Factory extends EnumeratedAttribute { - public String[] getValues() { - return new String[] { "one", "two", "three" }; - } -}