mirror of https://github.com/apache/archiva.git
Last commit
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-829@674160 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a2983df1d3
commit
9944376a5f
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
~ Licensed to the Apache Software Foundation (ASF) under one
|
||||
~ or more contributor license agreements. See the NOTICE file
|
||||
~ distributed with this work for additional information
|
||||
~ regarding copyright ownership. The ASF licenses this file
|
||||
~ to you under the Apache License, Version 2.0 (the
|
||||
~ "License"); you may not use this file except in compliance
|
||||
~ with the License. You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="organisationName">
|
||||
<field-validator type="requiredstring">
|
||||
<message>You must enter a name</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="organisationUrl">
|
||||
<field-validator type="url">
|
||||
<message>You must enter a URL</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="organisationLogo">
|
||||
<field-validator type="url">
|
||||
<message>You must enter a URL</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
|
@ -36,7 +36,7 @@
|
|||
<ww:set name="editOrganisationInfo" value="editOrganisationInfo"/>
|
||||
<ww:actionmessage/>
|
||||
<ww:form method="post" action="saveAppearance" namespace="/admin" validate="true" theme="xhtml">
|
||||
<ww:textfield name="organisationName" value="${organisationName}" label="Name" size="50" />
|
||||
<ww:textfield name="organisationName" value="${organisationName}" label="Name" size="50" />
|
||||
<ww:textfield name="organisationUrl" value="${organisationUrl}" label="URL" size="50"/>
|
||||
<ww:textfield name="organisationLogo" value="${organisationLogo}" label="Logo URL" size="50" />
|
||||
<ww:submit value="Save"/>
|
||||
|
|
|
@ -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 <a href="mailto:james@atlassian.com">James William Dumay</a>
|
||||
*/
|
||||
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 );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue