From 9944376a5f3a18d884851172af9589173ab071bc Mon Sep 17 00:00:00 2001 From: James William Dumay Date: Sat, 5 Jul 2008 08:32:04 +0000 Subject: [PATCH] Last commit git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-829@674160 13f79535-47bb-0310-9956-ffa450edef68 --- .../EditOrganisationInfoAction-validation.xml | 40 ++++++++++++++++ .../WEB-INF/jsp/admin/editAppearance.jsp | 2 +- .../AbstractOrganizationInfoActionTest.java | 47 +++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction-validation.xml create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractOrganizationInfoActionTest.java diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction-validation.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction-validation.xml new file mode 100644 index 000000000..38b3bcfa8 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction-validation.xml @@ -0,0 +1,40 @@ + + + + + + + + + You must enter a name + + + + + You must enter a URL + + + + + You must enter a URL + + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp index bf0dd543c..5f5316a2a 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp @@ -36,7 +36,7 @@ - + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractOrganizationInfoActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractOrganizationInfoActionTest.java new file mode 100644 index 000000000..c840c2381 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractOrganizationInfoActionTest.java @@ -0,0 +1,47 @@ +package org.apache.maven.archiva.web.action.admin.appearance; + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.web.action.AbstractWebworkTestCase; +import org.easymock.MockControl; + +/** + * @author James William Dumay + */ +public abstract class AbstractOrganizationInfoActionTest extends AbstractWebworkTestCase +{ + protected MockControl archivaConfigurationControl; + + protected ArchivaConfiguration configuration; + + protected AbstractAppearanceAction action; + + protected Configuration config; + + protected abstract AbstractAppearanceAction getAction(); + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + config = new Configuration(); + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + configuration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + + configuration.getConfiguration(); + archivaConfigurationControl.setReturnValue(config, 1, 2); + + configuration.save(config); + archivaConfigurationControl.setVoidCallable(1, 2); + + archivaConfigurationControl.replay(); + } + + protected void reloadAction() + { + action = getAction(); + action.setConfiguration( configuration ); + } +} -- 2.39.5