KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > artifact > manager > DefaultWagonManagerTest


1 package org.apache.maven.artifact.manager;
2
3 /* ====================================================================
4  * Copyright 2001-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  * ====================================================================
18  */

19
20 import org.apache.maven.wagon.UnsupportedProtocolException;
21 import org.apache.maven.wagon.Wagon;
22 import org.codehaus.plexus.PlexusTestCase;
23
24 /**
25  * @author <a HREF="michal.maczka@dimatics.com">Michal Maczka</a>
26  * @version $Id: DefaultWagonManagerTest.java 163442 2005-03-01 06:28:57Z brett $
27  */

28 public class DefaultWagonManagerTest
29     extends PlexusTestCase
30 {
31     public void testDefaultWagonManager()
32         throws Exception JavaDoc
33     {
34         WagonManager wagonManager = (WagonManager) lookup( WagonManager.ROLE );
35
36         Wagon wagon = null;
37
38         wagon = (Wagon) wagonManager.getWagon( "a" );
39
40         assertNotNull( wagon );
41
42         wagon = (Wagon) wagonManager.getWagon( "b1" );
43
44         assertNotNull( wagon );
45
46         wagon = (Wagon) wagonManager.getWagon( "b2" );
47
48         assertNotNull( wagon );
49
50         wagon = (Wagon) wagonManager.getWagon( "c" );
51
52         assertNotNull( wagon );
53
54         try
55         {
56             wagon = (Wagon) wagonManager.getWagon( "d" );
57
58             fail( "Expected :" + UnsupportedProtocolException.class.getName() );
59         }
60         catch ( UnsupportedProtocolException e )
61         {
62             //ok
63
assertTrue( true );
64         }
65     }
66 }
67
Popular Tags