View Javadoc

1   package org.apache.maven.wagon.providers.webdav;
2   
3   import org.mortbay.jetty.Connector;
4   import org.mortbay.jetty.Server;
5   import org.mortbay.jetty.security.SslSocketConnector;
6   
7   /*
8    * Licensed to the Apache Software Foundation (ASF) under one
9    * or more contributor license agreements.  See the NOTICE file
10   * distributed with this work for additional information
11   * regarding copyright ownership.  The ASF licenses this file
12   * to you under the Apache License, Version 2.0 (the
13   * "License"); you may not use this file except in compliance
14   * with the License.  You may obtain a copy of the License at
15   *
16   *   http://www.apache.org/licenses/LICENSE-2.0
17   *
18   * Unless required by applicable law or agreed to in writing,
19   * software distributed under the License is distributed on an
20   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21   * KIND, either express or implied.  See the License for the
22   * specific language governing permissions and limitations
23   * under the License.
24   */
25  
26  
27  /**
28   * WebDAV Wagon Test
29   * 
30   * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
31   * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
32   */
33  public class WebDavsWagonTest
34      extends WebDavWagonTest
35  {
36      protected String getProtocol()
37      {
38          return "davs";
39      }
40  
41      protected void addConnectors( Server server )
42      {
43          System.setProperty( "javax.net.ssl.trustStore",
44                              getTestFile( "src/test/resources/ssl/keystore" ).getAbsolutePath() );
45  
46          SslSocketConnector connector = new SslSocketConnector();
47          connector.setPort( server.getConnectors()[0].getPort() );
48          connector.setKeystore( getTestPath( "src/test/resources/ssl/keystore" ) );
49          connector.setPassword( "wagonhttp" );
50          connector.setKeyPassword( "wagonhttp" );
51          connector.setTruststore( getTestPath( "src/test/resources/ssl/keystore" ) );
52          connector.setTrustPassword( "wagonhttp" );
53          server.setConnectors( new Connector[] { connector } );
54      }
55  
56  }