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
This commit is contained in:
Olivier Lamy 2011-05-27 21:24:52 +00:00
parent 59fddac27f
commit 7abf32f317
2 changed files with 34 additions and 2 deletions

View File

@ -20,6 +20,7 @@
*/
import junit.framework.TestCase;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
@ -118,10 +119,11 @@ public abstract class AbstractProxyTestCase
protected MockConfiguration config;
@Inject
@Named( value = "wagon#test" )
WagonDelegate delegate;
@Inject
PlexusSisuBridge plexusSisuBridge;
@Before
public void setUp()
throws Exception
@ -180,6 +182,8 @@ public void setUp()
wagonMockControl = MockControl.createNiceControl( Wagon.class );
wagonMock = (Wagon) wagonMockControl.getMock();
delegate = (WagonDelegate) plexusSisuBridge.lookup( Wagon.class, "test" );
delegate.setDelegate( wagonMock );
System.out.println( "\n.\\ " + getName() + "() \\._________________________________________\n" );

View File

@ -0,0 +1,28 @@
<!--
~ 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>