FileDocCategorySizeDatePackage
RpmTest.javaAPI DocApache Ant 1.702449Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant.taskdefs.optional

RpmTest

public class RpmTest extends TestCase

Fields Summary
Constructors Summary
Methods Summary
public voidtestShouldNotThrowExceptionWhenRpmFails()

        Rpm rpm = new MyRpm();
        rpm.execute();
    
public voidtestShouldThrowExceptionWhenRpmFails()

        Rpm rpm = new MyRpm();
        rpm.setProject(new org.apache.tools.ant.Project());
        rpm.setFailOnError(true);
        // execute
        try {
            rpm.execute();
            fail("should have thrown a build exception");
        } catch (BuildException ex) {
            assertTrue(ex.getMessage()
                       .indexOf("' failed with exit code 2") != -1);
        }