001package org.apache.maven.wagon.providers.ssh.jsch;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *   http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.apache.maven.wagon.Wagon;
023import org.apache.maven.wagon.providers.ssh.AbstractEmbeddedScpWagonTest;
024import org.apache.maven.wagon.providers.ssh.knownhost.KnownHostEntry;
025import org.apache.maven.wagon.providers.ssh.knownhost.KnownHostsProvider;
026
027import java.io.IOException;
028
029/**
030 * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
031 *
032 */
033public class EmbeddedScpWagonTest
034    extends AbstractEmbeddedScpWagonTest
035{
036
037    @Override
038    protected Wagon getWagon()
039        throws Exception
040    {
041        ScpWagon scpWagon = (ScpWagon) super.getWagon();
042        scpWagon.setInteractive( false );
043        scpWagon.setKnownHostsProvider( new KnownHostsProvider()
044        {
045            public void storeKnownHosts( String contents )
046                throws IOException
047            {
048
049            }
050
051            public void addKnownHost( KnownHostEntry knownHost )
052                throws IOException
053            {
054            }
055
056            public void setHostKeyChecking( String hostKeyChecking )
057            {
058            }
059
060            public String getHostKeyChecking()
061            {
062                return "no";
063            }
064
065            public String getContents()
066            {
067                return null;
068            }
069        } );
070        return scpWagon;
071    }
072
073
074    protected String getProtocol()
075    {
076        return "scp";
077    }
078
079
080
081    @Override
082    protected boolean supportsGetIfNewer()
083    {
084        return false;
085    }
086
087
088}