View Javadoc

1   package org.apache.maven.wagon.providers.ssh.jsch;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.wagon.Wagon;
23  import org.apache.maven.wagon.authentication.AuthenticationInfo;
24  import org.apache.maven.wagon.providers.ssh.AbstractEmbeddedScpWagonTest;
25  import org.apache.maven.wagon.providers.ssh.SshServerEmbedded;
26  import org.apache.maven.wagon.providers.ssh.TestData;
27  import org.apache.maven.wagon.providers.ssh.knownhost.KnownHostsProvider;
28  import org.apache.maven.wagon.repository.Repository;
29  import org.apache.maven.wagon.resource.Resource;
30  
31  import java.io.File;
32  import java.io.IOException;
33  
34  /**
35   * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
36   * @version $Id: EmbeddedScpWagonTest.java 1174024 2011-09-22 09:52:09Z olamy $
37   */
38  public class EmbeddedScpWagonTest
39      extends AbstractEmbeddedScpWagonTest
40  {
41  
42      SshServerEmbedded sshServerEmbedded;
43  
44      @Override
45      protected Wagon getWagon()
46          throws Exception
47      {
48          ScpWagon scpWagon = (ScpWagon) super.getWagon();
49          scpWagon.setInteractive( false );
50          scpWagon.setKnownHostsProvider( new KnownHostsProvider()
51          {
52              public void storeKnownHosts( String contents )
53                  throws IOException
54              {
55  
56              }
57  
58              public void setHostKeyChecking( String hostKeyChecking )
59              {
60              }
61  
62              public String getHostKeyChecking()
63              {
64                  return "no";
65              }
66  
67              public String getContents()
68              {
69                  return null;
70              }
71          } );
72          return scpWagon;
73      }
74  
75  
76      protected String getProtocol()
77      {
78          return "scp";
79      }
80  
81  
82  
83      @Override
84      protected boolean supportsGetIfNewer()
85      {
86          return false;
87      }
88  
89  
90  }