net.sf.antcontrib.cpptasks
Class TestProcessorDef

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by net.sf.antcontrib.cpptasks.TestProcessorDef
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
TestCompilerDef, TestLinkerDef

public abstract class TestProcessorDef
extends junit.framework.TestCase

Tests for ProcessorDef.


Constructor Summary
TestProcessorDef(java.lang.String name)
          Constructor.
 
Method Summary
protected abstract  net.sf.antcontrib.cpptasks.ProcessorDef create()
          Creates a new processor definition.
protected  net.sf.antcontrib.cpptasks.ProcessorDef createExtendedProcessorDef(net.sf.antcontrib.cpptasks.ProcessorDef baseProcessor)
          Creates a processor initialized to be an extension of the base processor.
protected  net.sf.antcontrib.cpptasks.compiler.ProcessorConfiguration getConfiguration(net.sf.antcontrib.cpptasks.ProcessorDef extendedProcessor)
          Gets the processor configuration.
protected abstract  java.lang.String[] getPreArguments(net.sf.antcontrib.cpptasks.ProcessorDef processor)
          Gets command line arguments that precede filenames.
 void testExtendsDebug()
          Tests that the debug attribute in the base processor is effective when creating the command line for a processor that extends it.
protected  void testExtendsFileSet(java.io.File tempFile)
          Tests that a fileset in the base processor is effective when evaluating the files included in an extending processor.
 void testExtendsIf()
          Tests that the if attribute in the base processor is effective when evaluating if an extending processor is active.
protected  void testExtendsRebuild(net.sf.antcontrib.cpptasks.ProcessorDef baseProcessor)
          Tests that the rebuild attribute in the base processor is effective when creating the command line for a processor that extends it.
 void testExtendsUnless()
          Tests that the unless attribute in the base processor is effective when evaluating if an extending processor is active.
 void testIsActive2()
          Tests that isActive returns true when "if" references a set property.
 void testIsActive3()
          Tests that isActive returns false when "if" references an unset property.
 void testIsActive4()
          Tests that evaluating isActive when "if" refernces a property with the value "false" throws an exception to warn of a suspicious value.
 void testIsActive5()
          Tests that isActive returns false when "unless" references a set property.
 void testIsActive6()
          Tests that isActive returns true when "unless" references an unset property.
 void testIsActive7()
          Tests that evaluating isActive when "unless" references a property with the value "false" throws an exception to warn of a suspicious value.
 void testIsActive8()
          Tests if a processor is active when both "if" and "unless" are specified and the associated properties are set.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestProcessorDef

public TestProcessorDef(java.lang.String name)
Constructor.

Parameters:
name - test name
Method Detail

create

protected abstract net.sf.antcontrib.cpptasks.ProcessorDef create()
Creates a new processor definition.

Returns:
created processor definition

testIsActive2

public final void testIsActive2()
Tests that isActive returns true when "if" references a set property.


testIsActive3

public final void testIsActive3()
Tests that isActive returns false when "if" references an unset property.


testIsActive4

public final void testIsActive4()
Tests that evaluating isActive when "if" refernces a property with the value "false" throws an exception to warn of a suspicious value.


testIsActive5

public final void testIsActive5()
Tests that isActive returns false when "unless" references a set property.


testIsActive6

public final void testIsActive6()
Tests that isActive returns true when "unless" references an unset property.


testIsActive7

public final void testIsActive7()
Tests that evaluating isActive when "unless" references a property with the value "false" throws an exception to warn of a suspicious value.


testIsActive8

public final void testIsActive8()
Tests if a processor is active when both "if" and "unless" are specified and the associated properties are set.


createExtendedProcessorDef

protected final net.sf.antcontrib.cpptasks.ProcessorDef createExtendedProcessorDef(net.sf.antcontrib.cpptasks.ProcessorDef baseProcessor)
Creates a processor initialized to be an extension of the base processor.

Parameters:
baseProcessor - base processor
Returns:
extending processor

getConfiguration

protected final net.sf.antcontrib.cpptasks.compiler.ProcessorConfiguration getConfiguration(net.sf.antcontrib.cpptasks.ProcessorDef extendedProcessor)
Gets the processor configuration.

Parameters:
extendedProcessor - processor under test
Returns:
configuration

getPreArguments

protected abstract java.lang.String[] getPreArguments(net.sf.antcontrib.cpptasks.ProcessorDef processor)
Gets command line arguments that precede filenames.

Parameters:
processor - processor under test
Returns:
array of command line parameters

testExtendsFileSet

protected final void testExtendsFileSet(java.io.File tempFile)
                                 throws java.io.IOException
Tests that a fileset in the base processor is effective when evaluating the files included in an extending processor.

Parameters:
tempFile - temporary file
Throws:
java.io.IOException - if unable to delete file

testExtendsIf

public final void testExtendsIf()
Tests that the if attribute in the base processor is effective when evaluating if an extending processor is active.


testExtendsUnless

public final void testExtendsUnless()
Tests that the unless attribute in the base processor is effective when evaluating if an extending processor is active.


testExtendsDebug

public final void testExtendsDebug()
Tests that the debug attribute in the base processor is effective when creating the command line for a processor that extends it.


testExtendsRebuild

protected final void testExtendsRebuild(net.sf.antcontrib.cpptasks.ProcessorDef baseProcessor)
Tests that the rebuild attribute in the base processor is effective when creating the command line for a processor that extends it.

Parameters:
baseProcessor - processor under test


Copyright © 2001-2008 Ant-Contrib Project. All Rights Reserved.