*/
import com.opensymphony.xwork.Preparable;
-
import org.apache.commons.lang.StringUtils;
import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
import org.apache.maven.archiva.policies.DownloadPolicy;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
continue;
}
+ Map properties = connector.getProperties();
+ for ( Iterator j = properties.keySet().iterator(); j.hasNext(); )
+ {
+ String key = (String) j.next();
+
+ Object value = properties.get( key );
+ if ( value.getClass().isArray() )
+ {
+ String[] arr = (String[]) value;
+ properties.put( key, arr[0] );
+ }
+ }
+
// Ugly hack to compensate for ugly browsers.
Object o = connector.getPolicies().get( policyId );
String value;
*/
import com.opensymphony.xwork.Action;
-
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.IndeterminateConfigurationException;
action.prepare();
ProxyConnectorConfiguration connector = action.getConnector();
populateProxyConnector( connector );
+ // forms will use an array
+ connector.getProperties().put( "eat-a", new String[] { "gramov-a-bits" } );
// Create the input screen.
assertRequestStatus( action, Action.SUCCESS, "commit" );
assertNull( actualConnector.getProxyId() );
assertEquals( "corporate", actualConnector.getSourceRepoId() );
assertEquals( "central", actualConnector.getTargetRepoId() );
+ assertEquals( "gramov-a-bits", actualConnector.getProperties().get( "eat-a" ) );
}
public void testAddProxyConnectorInitialPage()
*/
import com.opensymphony.xwork.Action;
-
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.IndeterminateConfigurationException;
// Should have no error, and 1 property added.
assertNoErrors( action );
assertEquals( 1, connector.getProperties().size() );
+ assertEquals( "gramov-a-bits", connector.getProperties().get( "eat-a" ) );
}
public void testAddWhiteListPattern()
action.prepare();
ProxyConnectorConfiguration connector = action.getConnector();
assertInitialProxyConnector( connector );
+ // forms will use an array
+ connector.getProperties().put( "eat-a", new String[] { "gramov-a-bits" } );
// Create the input screen.
assertRequestStatus( action, Action.SUCCESS, "commit" );
assertNull( actualConnector.getProxyId() );
assertEquals( "corporate", actualConnector.getSourceRepoId() );
assertEquals( "central", actualConnector.getTargetRepoId() );
+
}
public void testEditProxyConnectorInitialPage()