dion 02/05/23 00:46:16
Modified: src/java/org/apache/maven/struts Struts10WarFile.java
src/test/org/apache/maven/struts Struts10WarFileTest.java
Log:
no message
Revision Changes Path
1.7 +18 -1
jakarta-turbine-maven/src/java/org/apache/maven/struts/Struts10WarFile.java
Index: Struts10WarFile.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/struts/Struts10WarFile.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Struts10WarFile.java 22 May 2002 09:49:18 -0000 1.6
+++ Struts10WarFile.java 23 May 2002 07:46:16 -0000 1.7
@@ -74,7 +74,7 @@
* Encapsulates a Struts 1.0 War File. Holds functionality to access Struts
* specific resources and data in the war.
* @author dion
- * @version $Id: Struts10WarFile.java,v 1.6 2002/05/22 09:49:18 dion Exp $
+ * @version $Id: Struts10WarFile.java,v 1.7 2002/05/23 07:46:16 dion Exp $
*/
public class Struts10WarFile extends WarFile
{
@@ -245,5 +245,22 @@
actions.add(action);
}
return actions;
+ }
+
+ /** retrieves the type attribute of the <form-beans> element if
+ * it exists, or null otherwise
+ * @return the form-bean type attribute
+ * @throws IOException when there are problems reading from the war
+ */
+ public String getFormBeansType() throws IOException
+ {
+ String type = null;
+ Element formBeans = (Element)getStrutsConfig().selectSingleNode(
+ "/struts-config/form-beans");
+ if (formBeans != null)
+ {
+ type = formBeans.attributeValue("type");
+ }
+ return type;
}
}
1.4 +4 -1
jakarta-turbine-maven/src/test/org/apache/maven/struts/Struts10WarFileTest.java
Index: Struts10WarFileTest.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/test/org/apache/maven/struts/Struts10WarFileTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Struts10WarFileTest.java 22 May 2002 09:34:47 -0000 1.3
+++ Struts10WarFileTest.java 23 May 2002 07:46:16 -0000 1.4
@@ -63,7 +63,7 @@
* Unit tests for {@link Struts10WarFile}
*
* @author dion
- * @version $Id: Struts10WarFileTest.java,v 1.3 2002/05/22 09:34:47 dion Exp $
+ * @version $Id: Struts10WarFileTest.java,v 1.4 2002/05/23 07:46:16 dion Exp $
*/
public class Struts10WarFileTest extends TestCase {
@@ -157,6 +157,9 @@
assertEquals("third form bean isn't subscriptionForm",
"subscriptionForm",
((FormBean)formBeans.get(2)).getName());
+ assertEquals("form beans type is not default",
+ "org.apache.struts.action.ActionFormBean",
+ instance.getFormBeansType());
}
/** test the retrieval of actions
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>