diff options
author | Olivier Lamy <olamy@apache.org> | 2011-05-27 21:24:52 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2011-05-27 21:24:52 +0000 |
commit | 7abf32f3171212a3d7197673e1a29b780631ee4d (patch) | |
tree | 11922dd41c7667e30fadaa2a9211675c4cf0c019 /archiva-modules/archiva-base | |
parent | 59fddac27f56219611977ed6611f0c01be6eb332 (diff) | |
download | archiva-7abf32f3171212a3d7197673e1a29b780631ee4d.tar.gz archiva-7abf32f3171212a3d7197673e1a29b780631ee4d.zip |
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
Diffstat (limited to 'archiva-modules/archiva-base')
2 files changed, 34 insertions, 2 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java index 56a56bf27..6a030dd4c 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java @@ -20,6 +20,7 @@ package org.apache.maven.archiva.proxy; */ 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 abstract class AbstractProxyTestCase 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" ); diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/resources/META-INF/plexus/components.xml b/archiva-modules/archiva-base/archiva-proxy/src/test/resources/META-INF/plexus/components.xml new file mode 100644 index 000000000..c4fe9a946 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/resources/META-INF/plexus/components.xml @@ -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> |