Remove use of BuildException and dependency on Ant

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114950 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
dion committed 2004-03-29 00:39:25 +00:00
1 parent 9567dd33e8
commit 5d6237c146
2 files changed
+7 -11

No files matched your search

@@ -22,8 +22,6 @@ import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import org.apache.tools.ant.BuildException;
import org.apache.maven.j2ee.war.FormLoginConfig;
/**
@@ -45,8 +43,7 @@ import org.apache.maven.j2ee.war.FormLoginConfig;
* &gt;</code> element must exist in the war file</li>
* </ol>
* @author dIon Gillard
* @version $Id: WarValidator.java,v 1.2 2004/03/02 15:05:55 evenisse Exp $
* @task Replace the use of BuildException
* @version $Id: WarValidator.java,v 1.3 2004/03/29 00:39:25 dion Exp $
*/
public class WarValidator
{
@@ -87,9 +84,9 @@ public class WarValidator
/**
* Perform the validation.
*
* @throws BuildException when any error occurs
* @throws IllegalStateException when any error occurs
*/
public void execute() throws BuildException
public void execute()
{
if (getWarFileName() == null)
{
@@ -98,7 +95,7 @@ public class WarValidator
validate();
if (getStatus().isError() && isFailOnError())
{
throw new BuildException("Errors occurred during validation. "
throw new IllegalStateException("Errors occurred during validation. "
+ "Messages should have been provided");
}
}
@@ -55,7 +55,6 @@ package org.apache.maven.j2ee;
*/
import junit.framework.TestCase;
import org.apache.tools.ant.BuildException;
import org.apache.maven.TestConstants;
@@ -63,7 +62,7 @@ import org.apache.maven.TestConstants;
* Unit test for <code>WarValidator</code>.
*
* @author <a href="mailto:dion@multitask.com.au">dIon Gillard</a>
* @version $Id: WarValidatorTest.java,v 1.1 2003/01/24 03:45:22 jvanzyl Exp $
* @version $Id: WarValidatorTest.java,v 1.2 2004/03/29 00:39:25 dion Exp $
*/
public class WarValidatorTest extends TestCase
{
@@ -148,7 +147,7 @@ public class WarValidatorTest extends TestCase
fail("Empty war file (with no META-INF, or WEB-INF/web.xml) has"
+ " succeeded");
}
catch (BuildException be)
catch (IllegalStateException e)
{
// this is the expected behaviour
}
@@ -171,7 +170,7 @@ public class WarValidatorTest extends TestCase
+ "(with no META-INF, or WEB-INF/web.xml)",
validator.getStatus().isError());
}
catch (BuildException be)
catch (IllegalStateException e)
{
fail("Empty war file (with no META-INF, or WEB-INF/web.xml) failed"
+ " the build process with failOnError=false");