[jboss-svn-commits] JBL Code SVN: r7560 - in labs/jbossesb/workspace/b_georges: nbproject product/core/listeners/tests/src/org/jboss/internal/soa/esb/util
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sun Nov 12 16:53:12 EST 2006
Author: b_georges
Date: 2006-11-12 16:53:07 -0500 (Sun, 12 Nov 2006)
New Revision: 7560
Modified:
labs/jbossesb/workspace/b_georges/nbproject/project.properties
labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/internal/soa/esb/util/SecureFtpImplUnitTest.java
Log:
Secure FTP - Will probably refactor this to be RemoteFileSystemUnitTest in the future. For now just want to test SFTP. Calling RemoteFileSystemFactory to get the correct instance - work in progress.
Modified: labs/jbossesb/workspace/b_georges/nbproject/project.properties
===================================================================
--- labs/jbossesb/workspace/b_georges/nbproject/project.properties 2006-11-12 21:40:45 UTC (rev 7559)
+++ labs/jbossesb/workspace/b_georges/nbproject/project.properties 2006-11-12 21:53:07 UTC (rev 7560)
@@ -16,9 +16,11 @@
dist.dir=dist
dist.jar=${dist.dir}/NetBeansProject-JBossEsb.jar
dist.javadoc.dir=${dist.dir}/javadoc
+file.reference.jbossts-common.jar=product/lib/ext/jbossts-common.jar
file.reference.jsch-0.1.jar=product/lib/ext/jsch-0.1.jar
file.reference.lib-ext=product/lib/ext
file.reference.listeners-src=product/core/listeners/src
+file.reference.log4j.jar=product/lib/ext/log4j.jar
file.reference.rosetta-src=product/core/rosetta/src
file.reference.services-src=product/core/services/src
file.reference.tests-src=product/core/listeners/tests/src
@@ -27,7 +29,9 @@
jar.compress=false
javac.classpath=\
${file.reference.lib-ext}:\
- ${file.reference.jsch-0.1.jar}
+ ${file.reference.jsch-0.1.jar}:\
+ ${file.reference.log4j.jar}:\
+ ${file.reference.jbossts-common.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/internal/soa/esb/util/SecureFtpImplUnitTest.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/internal/soa/esb/util/SecureFtpImplUnitTest.java 2006-11-12 21:40:45 UTC (rev 7559)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/internal/soa/esb/util/SecureFtpImplUnitTest.java 2006-11-12 21:53:07 UTC (rev 7560)
@@ -23,6 +23,7 @@
import com.jcraft.jsch.SftpATTRS;
import com.jcraft.jsch.UserInfo;
import com.jcraft.jsch.ChannelSftp.LsEntry;
+import org.jboss.soa.esb.util.RemoteFileSystemFactory;
/**
*
@@ -30,16 +31,21 @@
*/
public class SecureFtpImplUnitTest extends BaseTest {
+ RemoteFileSystem secureFtpInstance;
+
public SecureFtpImplUnitTest(String testName) {
super(testName);
}
-
+
protected void setUp() throws Exception {
+ // TODO: check if this is the best way
+ ConfigTree config = ConfigTree.fromInputStream(getClass().getResourceAsStream("secure-ftp-config.xml"));
+ secureFtpInstance = RemoteFileSystemFactory.getRemoteFileSystem(config,true);
}
-
+
protected void tearDown() throws Exception {
}
-
+
/**
* Test of deleteRemoteFile method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
*/
@@ -47,14 +53,13 @@
log.info("deleteRemoteFile");
String p_sFile = "";
- SecureFtpImpl instance = null;
- instance.deleteRemoteFile(p_sFile);
+ secureFtpInstance.deleteRemoteFile(p_sFile);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
-
+
/**
* Test of remoteDelete method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
*/
@@ -62,14 +67,13 @@
log.info("remoteDelete");
File p_oFile = null;
- SecureFtpImpl instance = null;
- instance.remoteDelete(p_oFile);
+ secureFtpInstance.remoteDelete(p_oFile);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
-
+
/**
* Test of getFileListFromRemoteDir method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
*/
@@ -77,16 +81,15 @@
log.info("getFileListFromRemoteDir");
String p_sSuffix = "";
- SecureFtpImpl instance = null;
String[] expResult = null;
- String[] result = instance.getFileListFromRemoteDir(p_sSuffix);
+ String[] result = secureFtpInstance.getFileListFromRemoteDir(p_sSuffix);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
-
+
/**
* Test of setRemoteDir method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
*/
@@ -94,14 +97,13 @@
log.info("setRemoteDir");
String p_sDir = "";
- SecureFtpImpl instance = null;
- instance.setRemoteDir(p_sDir);
+ secureFtpInstance.setRemoteDir(p_sDir);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
-
+
/**
* Test of renameInRemoteDir method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
*/
@@ -110,14 +112,13 @@
String p_sFrom = "";
String p_sTo = "";
- SecureFtpImpl instance = null;
- instance.renameInRemoteDir(p_sFrom, p_sTo);
+ secureFtpInstance.renameInRemoteDir(p_sFrom, p_sTo);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
-
+
/**
* Test of remoteRename method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
*/
@@ -126,14 +127,13 @@
File p_oFrom = null;
File p_oTo = null;
- SecureFtpImpl instance = null;
- instance.remoteRename(p_oFrom, p_oTo);
+ secureFtpInstance.remoteRename(p_oFrom, p_oTo);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
-
+
/**
* Test of uploadFile method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
*/
@@ -142,14 +142,13 @@
File p_oFile = null;
String p_sRemoteName = "";
- SecureFtpImpl instance = null;
- instance.uploadFile(p_oFile, p_sRemoteName);
+ secureFtpInstance.uploadFile(p_oFile, p_sRemoteName);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
-
+
/**
* Test of downloadFile method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
*/
@@ -158,58 +157,37 @@
String p_sFile = "";
String p_sFinalName = "";
- SecureFtpImpl instance = null;
- instance.downloadFile(p_sFile, p_sFinalName);
+ secureFtpInstance.downloadFile(p_sFile, p_sFinalName);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
-
+
/**
* Test of getRemoteDir method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
*/
public void testGetRemoteDir() {
log.info("getRemoteDir");
- SecureFtpImpl instance = null;
-
String expResult = "";
- String result = instance.getRemoteDir();
+ String result = secureFtpInstance.getRemoteDir();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
-
+
/**
* Test of quit method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
*/
public void testQuit() {
log.info("quit");
- SecureFtpImpl instance = null;
+ secureFtpInstance.quit();
- instance.quit();
-
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
-
- /**
- * Test of fileToFtpString method, of class org.jboss.internal.soa.esb.util.SecureFtpImpl.
- */
- public void testFileToFtpString() {
- log.info("fileToFtpString");
-
- File p_oF = null;
-
- String expResult = "";
- String result = SecureFtpImpl.fileToFtpString(p_oF);
- assertEquals(expResult, result);
-
- // TODO review the generated test code and remove the default call to fail.
- fail("The test case is a prototype.");
- }
}
More information about the jboss-svn-commits
mailing list