View Javadoc
1   package org.apache.maven.wagon.providers.webdav;
2   
3   import org.eclipse.jetty.server.Server;
4   import org.eclipse.jetty.server.ServerConnector;
5   import org.eclipse.jetty.util.ssl.SslContextFactory;
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 ServerConnector addConnector( Server server )
42      {
43          System.setProperty( "javax.net.ssl.trustStore",
44                              getTestFile( "src/test/resources/ssl/keystore" ).getAbsolutePath() );
45  
46          SslContextFactory sslContextFactory = new SslContextFactory();
47          sslContextFactory.setKeyStorePath( getTestPath( "src/test/resources/ssl/keystore" ) );
48          sslContextFactory.setKeyStorePassword( "wagonhttp" );
49          sslContextFactory.setKeyManagerPassword( "wagonhttp" );
50          sslContextFactory.setTrustStorePath( getTestPath( "src/test/resources/ssl/keystore" ) );
51          sslContextFactory.setTrustStorePassword( "wagonhttp" );
52  
53          ServerConnector serverConnector = new ServerConnector( server, sslContextFactory );
54          server.addConnector( serverConnector );
55          return serverConnector;
56      }
57  
58  }