FileDocCategorySizeDatePackage
MacroDefTest.javaAPI DocApache Ant 1.704678Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.taskdefs

MacroDefTest

public class MacroDefTest extends org.apache.tools.ant.BuildFileTest

Fields Summary
Constructors Summary
public MacroDefTest(String name)

        super(name);
    
Methods Summary
public voidsetUp()

        configureProject("src/etc/testcases/taskdefs/macrodef.xml");
    
public voidtestAttributeDescription()

        expectLog(
            "attribute.description",
            "description is hello world");
    
public voidtestBackTrace()

        expectBuildExceptionContaining(
            "backtraceon",
            "Checking if a back trace is created",
            "following error occurred");
    
public voidtestBackTraceOff()

        try {
            executeTarget("backtraceoff");
        } catch (BuildException ex) {
            if (ex.getMessage().indexOf("following error occurred") != -1) {
                fail("error message contained backtrace - " + ex.getMessage());
            }
        }
    
public voidtestDouble()

        expectLog(
            "double",
            "@{prop} is 'property', value of ${property} is 'A property value'");
    
public voidtestDuplicateAttribute()

        expectBuildException(
            "duplicate.attribute",
            "the attribute text has already been specified");
    
public voidtestDuplicateElement()

        expectBuildException(
            "duplicate.element",
            "the element text has already been specified");
    
public voidtestDuplicateTextName()

        expectBuildException(
            "duplicatetextname",
            "the name \"text\" is already used as an attribute");
    
public voidtestDuplicateTextName2()

        expectBuildException(
            "duplicatetextname2",
            "the attribute name \"text\" has already been used by the text element");
    
public voidtestEscape()

        expectLog(
            "escape",
            "a@b or a@b is avalue@bvalue");
    
public voidtestIgnoreCase()

        expectLog(
            "ignorecase",
            "a is ab is b");
    
public voidtestIgnoreElementCase()

        expectLog(
            "ignore-element-case",
            "nested elementnested element");
    
public voidtestImplicit()

        expectLog(
            "implicit", "Before implicitIn implicitAfter implicit");
    
public voidtestImplicitExplicit()

        expectSpecificBuildException(
            "implicit.explicit",
            "Only one element allowed when using implicit elements",
            "Only one element allowed when using implicit elements");
    
public voidtestImplicitNotOptional()

        expectSpecificBuildException(
            "implicit.notoptional",
            "Missing nested elements for implicit element implicit",
            "Missing nested elements for implicit element implicit");
    
public voidtestImplicitOptional()

        expectLog(
            "implicit.optional", "Before implicitAfter implicit");
    
public voidtestNested()

        expectLog("nested", "A nested element");
    
public voidtestOverrideDefault()

        expectLog(
            "override.default",
            "value is new");
    
public voidtestSimple()

        expectLog("simple", "Hello World");
    
public voidtestText()

        expectLog("text", "Inner Text");
    
public voidtestTextElement()

        expectLogContaining(
            "textelement", "Hello world");
    
public voidtestTextTrim()

        expectLogContaining(
            "text.trim", "[Hello world]");
    
public voidtestTopLevelText()

        expectLogContaining("top-level-text", "Hello World");
    
public voidtestUri()

        expectLog("uri", "Hello World");