git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@463712 13f79535-47bb-0310-9956-ffa450edef68master
@@ -1697,7 +1697,7 @@ see ${build.junit.reports} / ${antunit.reports} | |||||
if="junit.batch"> | if="junit.batch"> | ||||
<property name="junit.includes" value="**/*Test*" /> | <property name="junit.includes" value="**/*Test*" /> | ||||
<property name="junit.excludes" value="**/*Test_*" /> | |||||
<property name="junit.excludes" value="" /> | |||||
<test-junit> | <test-junit> | ||||
<formatter type="brief" usefile="false"/> | <formatter type="brief" usefile="false"/> | ||||
@@ -48,14 +48,10 @@ public class EnumeratedAttributeTest extends TestCase { | |||||
} | } | ||||
public void testFactory() { | 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 { | 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."); | fail("Factory should fail when trying to set an illegal value."); | ||||
} catch (BuildException be) { | } catch (BuildException be) { | ||||
// was expected | // was expected | ||||
@@ -96,5 +92,11 @@ public class EnumeratedAttributeTest extends TestCase { | |||||
return null; | return null; | ||||
} | } | ||||
} | } | ||||
public static class Factory extends EnumeratedAttribute { | |||||
public String[] getValues() { | |||||
return new String[] { "one", "two", "three" }; | |||||
} | |||||
} | |||||
} | } |
@@ -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" }; | |||||
} | |||||
} |