[jboss-svn-commits] JBL Code SVN: r8116 - in labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss: . internal internal/soa internal/soa/esb internal/soa/esb/util

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Dec 7 08:37:55 EST 2006


Author: b_georges
Date: 2006-12-07 08:37:51 -0500 (Thu, 07 Dec 2006)
New Revision: 8116

Added:
   labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/
   labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/
   labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/
   labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/util/
   labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpImplUnitTest.java
   labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml
Log:
Started work on SecureFtpImpl unit testing

Added: labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpImplUnitTest.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpImplUnitTest.java	2006-12-07 13:35:45 UTC (rev 8115)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpImplUnitTest.java	2006-12-07 13:37:51 UTC (rev 8116)
@@ -0,0 +1,264 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.InputStream;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.EsbListenerControllerFactory;
+import org.jboss.soa.esb.util.RemoteFileSystem;
+import org.jboss.soa.esb.util.RemoteFileSystemFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SecureFtpImplUnitTest
+{
+
+	private static Logger _logger = Logger.getLogger(SecureFtpImplUnitTest.class);
+
+	static String _secureFtpConfig		= "secureFtpTestConfig.xml";
+
+	private static final String TMP_DIR	= System.getProperty("java.io.tmpdir","/tmp"); 
+
+	private RemoteFileSystem secureFtpInstance;
+	
+	ConfigTree config = null;
+
+	@BeforeClass
+	protected static void setUp() throws Exception
+	{
+		
+    	String os = System.getProperty("os.name").toLowerCase();
+		if (os.indexOf("windows")>=0)
+		{
+			_secureFtpConfig = "secureFtpTestConfigWindows.xml";
+		}
+
+	}
+
+	@AfterClass
+	protected void tearDown() throws Exception
+	{
+		_logger.info("tearDown. Closing Connection and deleting files");
+		
+		secureFtpInstance.quit();
+	}
+
+	
+	/**
+	 * Test of deleteRemoteFile method, of class
+	 * org.jboss.internal.soa.esb.util.SecureFtpImpl.
+	 */
+	@Test
+	public void testDeleteRemoteFile() throws Exception
+	{
+		InputStream inStream = getClass().getResourceAsStream(_secureFtpConfig);
+		ConfigTree tree = ConfigTree.fromInputStream(inStream);
+		secureFtpInstance = (SecureFtpImpl) RemoteFileSystemFactory.getRemoteFileSystem(tree,
+				true);
+	
+		
+		_logger.info("deleteRemoteFile");
+
+		String 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.
+	 */
+	@Test
+	public void testRemoteDelete() throws Exception
+	{
+		_logger.info("remoteDelete");
+
+		File p_oFile = null;
+
+		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.
+	 */
+	@Test
+	public void testGetFileListFromRemoteDir() throws Exception
+	{
+		_logger.info("getFileListFromRemoteDir");
+
+		String p_sSuffix = "";
+
+		String[] expResult = null;
+		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.
+	 */
+	@Test
+	public void testSetRemoteDir() throws Exception
+	{
+		_logger.info("setRemoteDir");
+
+		String 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.
+	 */
+	@Test
+	public void testRenameInRemoteDir() throws Exception
+	{
+		_logger.info("renameInRemoteDir");
+
+		String p_sFrom = "";
+		String 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.
+	 */
+	@Test
+	public void testRemoteRename() throws Exception
+	{
+		_logger.info("remoteRename");
+
+		File p_oFrom = null;
+		File p_oTo = null;
+
+		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.
+	 */
+	@Test
+	public void testUploadFile() throws Exception
+	{
+		_logger.info("uploadFile");
+
+		File p_oFile = null;
+		String 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.
+	 */
+	@Test
+	public void testDownloadFile() throws Exception
+	{
+		_logger.info("downloadFile");
+
+		String p_sFile = "";
+		String 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.
+	 */
+	@Test
+	public void testGetRemoteDir()
+	{
+		_logger.info("getRemoteDir");
+
+		String expResult = "";
+		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.
+	 */
+	@Test
+	public void testQuit()
+	{
+		_logger.info("quit");
+
+		secureFtpInstance.quit();
+
+		// TODO review the generated test code and remove the default call to
+		// fail.
+		fail("The test case is a prototype.");
+	}
+
+}

Added: labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml	2006-12-07 13:35:45 UTC (rev 8115)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml	2006-12-07 13:37:51 UTC (rev 8116)
@@ -0,0 +1,18 @@
+<JBossESB parameterReloadSecs="120">
+	<FtpDownloadTest listenerClass="org.jboss.soa.esb.listeners.gateway.SecureFtpGateway" 
+		actionClass="org.jboss.soa.esb.actions.FtpDownloader" 
+		pollLatencySecs="30" 
+		maxThreads="1" 
+		inputDir="/logs" 
+		inputSuffix=".zip" 
+		workSuffix=".INPROC" 
+		errorDir="/" 
+		errorSuffix=".ERR" 
+		postDelete="true" 
+		ftpServer="ftp.xxx.xx" 
+		ftpUser="user" 
+		ftpPassword="password" 
+		ftpLocalDir="/home/dbrum/dev/beta1/fromFTP" ftpAscii="true">
+		ftpPassive="true"
+        </FtpDownloadTest>
+</JBossESB>




More information about the jboss-svn-commits mailing list