You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by gn...@apache.org on 2008/12/04 19:59:36 UTC
svn commit: r723396 [12/12] - in /mina/sshd/trunk: ./ src/ src/docs/
src/main/ src/main/filtered-resources/ src/main/filtered-resources/org/
src/main/filtered-resources/org/apache/
src/main/filtered-resources/org/apache/sshd/ src/main/java/ src/main/ja...
Added: mina/sshd/trunk/src/test/java/org/apache/sshd/TestSpringConfig.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/src/test/java/org/apache/sshd/TestSpringConfig.java?rev=723396&view=auto
==============================================================================
--- mina/sshd/trunk/src/test/java/org/apache/sshd/TestSpringConfig.java (added)
+++ mina/sshd/trunk/src/test/java/org/apache/sshd/TestSpringConfig.java Thu Dec 4 10:59:31 2008
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd;
+
+import java.io.OutputStream;
+
+import org.junit.Test;
+import org.junit.Before;
+import org.junit.After;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import com.jcraft.jsch.Channel;
+import com.jcraft.jsch.Logger;
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.UserInfo;
+
+public class TestSpringConfig {
+
+ private ClassPathXmlApplicationContext context;
+
+ @Before
+ public void setUp() throws Exception {
+ context = new ClassPathXmlApplicationContext("classpath:spring.xml");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ if (context != null) {
+ context.destroy();
+ }
+ }
+
+ @Test
+ public void testSpringConfig() throws Exception {
+ JSch sch = new JSch();
+ sch.setLogger(new Logger() {
+ public boolean isEnabled(int i) {
+ return true;
+ }
+
+ public void log(int i, String s) {
+ System.out.println("Log(jsch," + i + "): " + s);
+ }
+ });
+ com.jcraft.jsch.Session s = sch.getSession("smx", "localhost", 8000);
+ s.setUserInfo(new UserInfo() {
+ public String getPassphrase() {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+ public String getPassword() {
+ return "smx";
+ }
+ public boolean promptPassword(String message) {
+ return true;
+ }
+ public boolean promptPassphrase(String message) {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+ public boolean promptYesNo(String message) {
+ return true;
+ }
+ public void showMessage(String message) {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+ });
+ s.connect();
+ Channel c = s.openChannel("shell");
+ c.connect();
+ OutputStream os = c.getOutputStream();
+ os.write("this is my command".getBytes());
+ os.flush();
+ Thread.sleep(100);
+ c.disconnect();
+ s.disconnect();
+ }
+
+
+}
Added: mina/sshd/trunk/src/test/java/org/apache/sshd/util/BogusPasswordAuthenticator.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/src/test/java/org/apache/sshd/util/BogusPasswordAuthenticator.java?rev=723396&view=auto
==============================================================================
--- mina/sshd/trunk/src/test/java/org/apache/sshd/util/BogusPasswordAuthenticator.java (added)
+++ mina/sshd/trunk/src/test/java/org/apache/sshd/util/BogusPasswordAuthenticator.java Thu Dec 4 10:59:31 2008
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.util;
+
+import org.apache.sshd.server.PasswordAuthenticator;
+
+public class BogusPasswordAuthenticator implements PasswordAuthenticator {
+
+ public Object authenticate(String username, String password) {
+ return (username != null && username.equals(password)) ? username : null;
+ }
+}
Added: mina/sshd/trunk/src/test/java/org/apache/sshd/util/BogusPublickeyAuthenticator.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/src/test/java/org/apache/sshd/util/BogusPublickeyAuthenticator.java?rev=723396&view=auto
==============================================================================
--- mina/sshd/trunk/src/test/java/org/apache/sshd/util/BogusPublickeyAuthenticator.java (added)
+++ mina/sshd/trunk/src/test/java/org/apache/sshd/util/BogusPublickeyAuthenticator.java Thu Dec 4 10:59:31 2008
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.util;
+
+import java.security.PublicKey;
+
+import org.apache.sshd.server.PublickeyAuthenticator;
+
+public class BogusPublickeyAuthenticator implements PublickeyAuthenticator {
+
+ public boolean hasKey(String username, PublicKey key) {
+ return true;
+ }
+}
Added: mina/sshd/trunk/src/test/java/org/apache/sshd/util/Compression.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/src/test/java/org/apache/sshd/util/Compression.java?rev=723396&view=auto
==============================================================================
--- mina/sshd/trunk/src/test/java/org/apache/sshd/util/Compression.java (added)
+++ mina/sshd/trunk/src/test/java/org/apache/sshd/util/Compression.java Thu Dec 4 10:59:31 2008
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
+/*
+Copyright (c) 2002-2008 ymnk, JCraft,Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the distribution.
+
+ 3. The names of the authors may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
+INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.apache.sshd.util;
+import com.jcraft.jzlib.*;
+
+public class Compression implements com.jcraft.jsch.Compression {
+ static private final int BUF_SIZE=4096;
+
+ private int type;
+ private ZStream stream;
+ private byte[] tmpbuf=new byte[BUF_SIZE];
+
+ public Compression(){
+ stream=new ZStream();
+ }
+
+ public void init(int type, int level){
+ if(type==DEFLATER){
+ stream.deflateInit(level);
+ this.type=DEFLATER;
+ }
+ else if(type==INFLATER){
+ stream.inflateInit();
+ inflated_buf=new byte[BUF_SIZE];
+ this.type=INFLATER;
+ }
+ }
+ /*
+ static Compression getDeflater(int level){
+ Compression foo=new Compression();
+ foo.stream.deflateInit(level);
+ foo.type=DEFLATER;
+ return foo;
+ }
+ */
+ private byte[] inflated_buf;
+ /*
+ static Compression getInflater(){
+ Compression foo=new Compression();
+ foo.stream.inflateInit();
+ foo.inflated_buf=new byte[BUF_SIZE];
+ foo.type=INFLATER;
+ return foo;
+ }
+ */
+
+ public int compress(byte[] buf, int start, int len){
+ stream.next_in=buf;
+ stream.next_in_index=start;
+ stream.avail_in=len-start;
+ int status;
+ int outputlen=start;
+
+ do{
+ stream.next_out=tmpbuf;
+ stream.next_out_index=0;
+ stream.avail_out=BUF_SIZE;
+ status=stream.deflate(JZlib.Z_PARTIAL_FLUSH);
+ switch(status){
+ case JZlib.Z_OK:
+ System.arraycopy(tmpbuf, 0,
+ buf, outputlen,
+ BUF_SIZE-stream.avail_out);
+ outputlen+=(BUF_SIZE-stream.avail_out);
+ break;
+ default:
+ System.err.println("compress: deflate returnd "+status);
+ }
+ }
+ while(stream.avail_out==0);
+ return outputlen;
+ }
+
+ public byte[] uncompress(byte[] buffer, int start, int[] length){
+ int inflated_end=0;
+
+ stream.next_in=buffer;
+ stream.next_in_index=start;
+ stream.avail_in=length[0];
+
+ while(true){
+ stream.next_out=tmpbuf;
+ stream.next_out_index=0;
+ stream.avail_out=BUF_SIZE;
+ int status=stream.inflate(JZlib.Z_PARTIAL_FLUSH);
+ switch(status){
+ case JZlib.Z_OK:
+ if(inflated_buf.length<inflated_end+BUF_SIZE-stream.avail_out){
+ byte[] foo=new byte[inflated_end+BUF_SIZE-stream.avail_out];
+ System.arraycopy(inflated_buf, 0, foo, 0, inflated_end);
+ inflated_buf=foo;
+ }
+ System.arraycopy(tmpbuf, 0,
+ inflated_buf, inflated_end,
+ BUF_SIZE-stream.avail_out);
+ inflated_end+=(BUF_SIZE-stream.avail_out);
+ length[0]=inflated_end;
+ break;
+ case JZlib.Z_BUF_ERROR:
+ if(inflated_end>buffer.length-start){
+ byte[] foo=new byte[inflated_end+start];
+ System.arraycopy(buffer, 0, foo, 0, start);
+ System.arraycopy(inflated_buf, 0, foo, start, inflated_end);
+ buffer=foo;
+ }
+ else{
+ System.arraycopy(inflated_buf, 0, buffer, start, inflated_end);
+ }
+ length[0]=inflated_end;
+ return buffer;
+ default:
+ System.err.println("uncompress: inflate returnd "+status);
+ return null;
+ }
+ }
+ }
+}
Added: mina/sshd/trunk/src/test/java/org/apache/sshd/util/EchoShellFactory.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/src/test/java/org/apache/sshd/util/EchoShellFactory.java?rev=723396&view=auto
==============================================================================
--- mina/sshd/trunk/src/test/java/org/apache/sshd/util/EchoShellFactory.java (added)
+++ mina/sshd/trunk/src/test/java/org/apache/sshd/util/EchoShellFactory.java Thu Dec 4 10:59:31 2008
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.util;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.sshd.server.ShellFactory;
+
+public class EchoShellFactory implements ShellFactory {
+
+ public Shell createShell() {
+ return new EchoShell();
+ }
+
+ protected static class EchoShell implements DirectShell, Runnable {
+ private InputStream in;
+ private OutputStream out;
+ private OutputStream err;
+ private ExitCallback callback;
+ private Thread thread;
+
+ public void setInputStream(InputStream in) {
+ this.in = in;
+ }
+
+ public void setOutputStream(OutputStream out) {
+ this.out = out;
+ }
+
+ public void setErrorStream(OutputStream err) {
+ this.err = err;
+ }
+
+ public void setExitCallback(ExitCallback callback) {
+ this.callback = callback;
+ }
+
+ public void start(Map<String, String> env) throws IOException {
+ thread = new Thread(this, "EchoShell");
+ thread.start();
+ }
+
+ public void destroy() {
+ thread.interrupt();
+ }
+
+ public void run() {
+ BufferedReader r = new BufferedReader(new InputStreamReader(in));
+ try {
+ for (;;) {
+ String s = r.readLine();
+ if (s == null) {
+ return;
+ }
+ out.write((s + "\n").getBytes());
+ out.flush();
+ if ("exit".equals(s)) {
+ return;
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ callback.onExit(0);
+ }
+ }
+ }
+}
Added: mina/sshd/trunk/src/test/java/org/apache/sshd/util/TeePipedOutputStream.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/src/test/java/org/apache/sshd/util/TeePipedOutputStream.java?rev=723396&view=auto
==============================================================================
--- mina/sshd/trunk/src/test/java/org/apache/sshd/util/TeePipedOutputStream.java (added)
+++ mina/sshd/trunk/src/test/java/org/apache/sshd/util/TeePipedOutputStream.java Thu Dec 4 10:59:31 2008
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.util;
+
+import java.io.PipedOutputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+
+public class TeePipedOutputStream extends PipedOutputStream {
+
+ private OutputStream tee;
+
+ public TeePipedOutputStream(OutputStream tee) {
+ this.tee = tee;
+ }
+
+ @Override
+ public void write(int b) throws IOException {
+ super.write(b);
+ tee.write(b);
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ super.write(b, off, len);
+ tee.write(b, off, len);
+ }
+}
Added: mina/sshd/trunk/src/test/resources/dsaprivkey.pem
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/src/test/resources/dsaprivkey.pem?rev=723396&view=auto
==============================================================================
--- mina/sshd/trunk/src/test/resources/dsaprivkey.pem (added)
+++ mina/sshd/trunk/src/test/resources/dsaprivkey.pem Thu Dec 4 10:59:31 2008
@@ -0,0 +1,12 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIBuwIBAAKBgQDEA7leYDKyJOFJU3h0uPpWN52iTpJk8+IM53Vc/91k7pBIjjka
++MP24BMh+sI2SRhxg2AtvwnzRRBVJWzEA4+tuCI6WukgeDQtSNp3YuWzOMefZ6Wb
+SAk1Y4goZb7nyqV9HZSFNSqUFQRZM10L768VURBlerNqR//GqdVd8bp7lwIVAM39
+h6x2DeXbqUM8iOi01bh5jpLFAoGAEi1oFGFMEZXH/hCX+Y2VE5WvR+fBaoS9WuZl
+3E0wsWPzQhbL13yD+6Htxd3XoQvrHnzyrIgi2AiAmr3mLokQbZ3d92IxEBcNB/0p
+nVi020TXSeD/lWkpk5FRvgBiJ82/LeC2Lj6cssznX73aLUhR0tsSoJoXxas0sQKa
+/UJgq5wCgYAtgeY99J0JxplWGSyGY/1DUpgzhdgpLdDA/o/qIjBEeHXN0QX4Ajoa
+vHggJ2SwNtAxbQedBxqmB3mquFRtpfEP5zGzsVx5HHnljSH8u0SqEoLnYKFpluwh
+tZ/Q3F2NHslXw8Hw+pIaPe4PAINQPAu3U+BknNUkGpLg8zU6h5+B+wIVAKRqeps1
+Xl7MxZcSZp7FnmmmMecB
+-----END DSA PRIVATE KEY-----
Added: mina/sshd/trunk/src/test/resources/hostkey.pem
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/src/test/resources/hostkey.pem?rev=723396&view=auto
==============================================================================
--- mina/sshd/trunk/src/test/resources/hostkey.pem (added)
+++ mina/sshd/trunk/src/test/resources/hostkey.pem Thu Dec 4 10:59:31 2008
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDdfIWeSV4o68dRrKSzFd/Bk51E65UTmmSrmW0O1ohtzi6HzsDP
+jXgCtlTt3FqTcfFfI92IlTr4JWqC9UK1QT1ZTeng0MkPQmv68hDANHbt5CpETZHj
+W5q4OOgWhVvj5IyOC2NZHtKlJBkdsMAa15ouOOJLzBvAvbqOR/yUROsEiQIDAQAB
+AoGBANG3JDW6NoP8rF/zXoeLgLCj+tfVUPSczhGFVrQkAk4mWfyRkhN0WlwHFOec
+K89MpkV1ij/XPVzU4MNbQ2yod1KiDylzvweYv+EaEhASCmYNs6LS03punml42SL9
+97tOmWfVJXxlQoLiY6jHPU97vTc65k8gL+gmmrpchsW0aqmZAkEA/c8zfmKvY37T
+cxcLLwzwsqqH7g2KZGTf9aRmx2ebdW+QKviJJhbdluDgl1TNNFj5vCLznFDRHiqJ
+wq0wkZ39cwJBAN9l5v3kdXj21UrurNPdlV0n2GZBt2vblooQC37XHF97r2zM7Ou+
+Lg6MyfJClyguhWL9dxnGbf3btQ0l3KDstxMCQCRaiEqjAfIjWVATzeNIXDWLHXso
+b1kf5cA+cwY+vdKdTy4IeUR+Y/DXdvPWDqpf0C11aCVMohdLCn5a5ikFUycCQDhV
+K/BuAallJNfmY7JxN87r00fF3ojWMJnT/fIYMFFrkQrwifXQWTDWE76BSDibsosJ
+u1TGksnm8zrDh2UVC/0CQFrHTiSl/3DHvWAbOJawGKg46cnlDcAhSyV8Frs8/dlP
+7YGG3eqkw++lsghqmFO6mRUTKsBmiiB2wgLGhL5pyYY=
+-----END RSA PRIVATE KEY-----
Added: mina/sshd/trunk/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/src/test/resources/log4j.properties?rev=723396&view=auto
==============================================================================
--- mina/sshd/trunk/src/test/resources/log4j.properties (added)
+++ mina/sshd/trunk/src/test/resources/log4j.properties Thu Dec 4 10:59:31 2008
@@ -0,0 +1,38 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+
+#
+# The logging properties used during tests..
+#
+log4j.rootLogger=WARN, stdout
+#log4j.logger.org.apache.mina=TRACE
+#log4j.logger.org.apache.sshd.common.channel.Window=DEBUG
+
+# CONSOLE appender
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/servicemix-test.log
+log4j.appender.out.append=true
Added: mina/sshd/trunk/src/test/resources/spring.xml
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/src/test/resources/spring.xml?rev=723396&view=auto
==============================================================================
--- mina/sshd/trunk/src/test/resources/spring.xml (added)
+++ mina/sshd/trunk/src/test/resources/spring.xml Thu Dec 4 10:59:31 2008
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean name="sshServer" class="org.apache.sshd.SshServer" factory-method="setUpDefaultServer" init-method="start" destroy-method="stop">
+ <property name="port" value="8000" />
+ <property name="shellFactory">
+ <bean class="org.apache.sshd.server.shell.ProcessShellFactory">
+ <property name="command">
+ <list>
+ <value>/bin/sh</value>
+ <value>-i</value>
+ </list>
+ </property>
+ </bean>
+ </property>
+ <property name="keyPairProvider">
+ <bean class="org.apache.sshd.common.keyprovider.FileKeyPairProvider">
+ <constructor-arg>
+ <list>
+ <value>src/test/resources/hostkey.pem</value>
+ </list>
+ </constructor-arg>
+ </bean>
+ </property>
+ <property name="passwordAuthenticator">
+ <bean class="org.apache.sshd.util.BogusPasswordAuthenticator" />
+ </property>
+ <property name="publickeyAuthenticator">
+ <bean class="org.apache.sshd.util.BogusPublickeyAuthenticator" />
+ </property>
+ <!-- Standard properties -->
+ <!--
+ <property name="channelFactories">
+ <list>
+ <bean class="org.apache.sshd.server.channel.ChannelSession$Factory" />
+ </list>
+ </property>
+ <property name="cipherFactories">
+ <list>
+ <bean class="org.apache.sshd.common.cipher.AES128CBC$Factory" />
+ <bean class="org.apache.sshd.common.cipher.TripleDESCBC$Factory" />
+ <bean class="org.apache.sshd.common.cipher.BlowfishCBC$Factory" />
+ <bean class="org.apache.sshd.common.cipher.AES192CBC$Factory" />
+ <bean class="org.apache.sshd.common.cipher.AES256CBC$Factory" />
+ </list>
+ </property>
+ <property name="compressionFactories">
+ <list>
+ <bean class="org.apache.sshd.common.compression.CompressionNone$Factory" />
+ </list>
+ </property>
+ <property name="keyExchangeFactories">
+ <list>
+ <bean class="org.apache.sshd.server.kex.DHG1$Factory" />
+ </list>
+ </property>
+ <property name="macFactories">
+ <list>
+ <bean class="org.apache.sshd.common.mac.HMACMD5$Factory" />
+ <bean class="org.apache.sshd.common.mac.HMACSHA1$Factory" />
+ <bean class="org.apache.sshd.common.mac.HMACMD596$Factory" />
+ <bean class="org.apache.sshd.common.mac.HMACSHA196$Factory" />
+ </list>
+ </property>
+ <property name="randomFactory">
+ <bean class="org.apache.sshd.common.random.JceRandom$Factory" />
+ </property>
+ <property name="userAuthFactories">
+ <list>
+ <bean class="org.apache.sshd.server.auth.UserAuthPublicKey$Factory" />
+ <bean class="org.apache.sshd.server.auth.UserAuthPassword$Factory" />
+ </list>
+ </property>
+ <property name="signatureFactories">
+ <list>
+ <bean class="org.apache.sshd.common.signature.SignatureDSA$Factory" />
+ <bean class="org.apache.sshd.common.signature.SignatureRSA$Factory" />
+ </list>
+ </property>
+ -->
+ </bean>
+
+</beans>