ASF Bugzilla – Attachment 14273 Details for
Bug 33220
Optional RPM task succeeds even if RPM process fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Unit Test for bug fix.
RpmTest.java (text/plain), 1.14 KB, created by
Julian Simpson
on 2005-02-13 21:50:28 UTC
(
hide
)
Description:
Unit Test for bug fix.
Filename:
MIME Type:
Creator:
Julian Simpson
Created:
2005-02-13 21:50:28 UTC
Size:
1.14 KB
patch
obsolete
>package org.apache.tools.ant.taskdefs.optional; > >import org.apache.tools.ant.BuildException; >import org.apache.tools.ant.taskdefs.Execute; >import org.apache.tools.ant.taskdefs.ExecuteStreamHandler; >import org.apache.tools.ant.types.Commandline; >import junit.framework.TestCase; > >public class RpmTest extends TestCase { > > public void testShouldThrowExceptionWhenRpmFails() throws Exception { > // setup > // instantiate the RPM class and override some of the code so we can test > // the handling of the return code only. > Rpm rpm = new Rpm() { > protected Execute getExecute(Commandline toExecute, > ExecuteStreamHandler streamhandler) { > return new Execute() { > public int execute() { > return -1; > } > }; > } > > public void log(String msg) { > } > }; > > // execute > try { > rpm.execute(); > fail("We should have thrown a build exception"); > } catch (BuildException ex) { > assertTrue(ex.getMessage().indexOf("' failed with exit code -1") != -1); > } > > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 33220
:
14088
|
14150
| 14273 |
14274