Browse Source

fix use of delegate wagon in unit tests

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1128463 13f79535-47bb-0310-9956-ffa450edef68
tags/archiva-1.4-M1
Olivier Lamy 13 years ago
parent
commit
7abf32f317

+ 6
- 2
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java View File

*/ */


import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.ArrayUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ArchivaConfiguration;


protected MockConfiguration config; protected MockConfiguration config;


@Inject
@Named( value = "wagon#test" )
WagonDelegate delegate; WagonDelegate delegate;


@Inject
PlexusSisuBridge plexusSisuBridge;

@Before @Before
public void setUp() public void setUp()
throws Exception throws Exception
wagonMockControl = MockControl.createNiceControl( Wagon.class ); wagonMockControl = MockControl.createNiceControl( Wagon.class );
wagonMock = (Wagon) wagonMockControl.getMock(); wagonMock = (Wagon) wagonMockControl.getMock();


delegate = (WagonDelegate) plexusSisuBridge.lookup( Wagon.class, "test" );

delegate.setDelegate( wagonMock ); delegate.setDelegate( wagonMock );


System.out.println( "\n.\\ " + getName() + "() \\._________________________________________\n" ); System.out.println( "\n.\\ " + getName() + "() \\._________________________________________\n" );

+ 28
- 0
archiva-modules/archiva-base/archiva-proxy/src/test/resources/META-INF/plexus/components.xml View File

<!--
~ 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.
-->

<component-set>
<components>
<component>
<role>org.apache.maven.wagon.Wagon</role>
<role-hint>test</role-hint>
<implementation>org.apache.maven.archiva.proxy.WagonDelegate</implementation>
</component>
</components>
</component-set>

Loading…
Cancel
Save