[jboss-svn-commits] JBL Code SVN: r13673 - in labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb: server and 3 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Jul 20 10:29:48 EDT 2007
Author: kurt.stam at jboss.com
Date: 2007-07-20 10:29:48 -0400 (Fri, 20 Jul 2007)
New Revision: 13673
Added:
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/SimpleDeployUnitTestCase.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ftp/FtpUnitTestCase.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jca/JcaUnitTestCase.java
Removed:
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/objpersist/
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/rosetta/
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ftp/unit/
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jca/unit/
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/unit/SimpleDeployUnitTestCase.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/services/
Log:
JBESB-613, Cleaning up the package names, and deleting empty directories
Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/SimpleDeployUnitTestCase.java (from rev 13654, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/unit/SimpleDeployUnitTestCase.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/SimpleDeployUnitTestCase.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/SimpleDeployUnitTestCase.java 2007-07-20 14:29:48 UTC (rev 13673)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.soa.esb.server;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Sample client for the jboss container.
+ *
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z scott.stark at jboss.org $
+ */
+
+public class SimpleDeployUnitTestCase
+ extends JBossTestCase
+{
+ org.jboss.logging.Logger log = getLog();
+
+ static boolean deployed = false;
+ static int test = 0;
+
+ public SimpleDeployUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void sendAMessage(String msg, String destination) throws Exception
+ {
+
+ InitialContext iniCtx = getInitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ ConnectionFactory qcf = (ConnectionFactory) tmp;
+ Connection conn = qcf.createConnection();
+ Destination que = (Queue) iniCtx.lookup(destination);
+ Session session = conn.createSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ MessageProducer send = session.createProducer(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ conn.close();
+ }
+
+ public void testSimple() throws Exception
+ {
+ sendAMessage("Hello World", "queue/esb_gateway_channel");
+ Thread.sleep(2000); // wait for message to post.
+ String version = (String)getServer().getAttribute(new ObjectName(StatsMBean.objectName), "ExecutedVersion");
+ assertEquals(version, "scope1");
+
+ }
+
+ public void testScope() throws Exception
+ {
+ sendAMessage("Hello World", "queue/esb_gateway_channel_versioned");
+ Thread.sleep(2000); // wait for message to post.
+ String version = (String)getServer().getAttribute(new ObjectName(StatsMBean.objectName), "ExecutedVersion");
+ assertEquals(version, "scope2");
+
+ }
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(SimpleDeployUnitTestCase.class, "simple.esb, simple-scoped.esb");
+ }
+
+}
Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ftp/FtpUnitTestCase.java (from rev 13654, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ftp/unit/FtpUnitTestCase.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ftp/FtpUnitTestCase.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ftp/FtpUnitTestCase.java 2007-07-20 14:29:48 UTC (rev 13673)
@@ -0,0 +1,108 @@
+/*
+* 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.soa.esb.server.ftp;
+
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Date;
+
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.server.StatsMBean;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Sample client for the jboss container.
+ *
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z scott.stark at jboss.org $
+ */
+
+public class FtpUnitTestCase
+ extends JBossTestCase
+{
+ public FtpUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testFtp() throws Exception
+ {
+ sendFtp();
+ Thread.sleep(10000); // wait for message to post.
+ String version = (String)getServer().getAttribute(new ObjectName(StatsMBean.objectName), "ExecutedVersion");
+ assertEquals(version, "scope1");
+ }
+
+ public void sendFtp() throws Exception
+ {
+
+ final String hostname = "localhost";
+ final String username = "esb";
+ final String password = "esb";
+ final String filename = "FtpUnitTestCase-" + new Date().getTime() + ".dat";
+ final String contents = "Hello World from FTP";
+
+ final URL url;
+ final String filenameVal;
+ if (filename.charAt(0) == '/')
+
+ {
+ filenameVal = (filename.length() > 1 ? "%2F" + filename.substring(1) : "%2F");
+ }
+
+ else
+
+ {
+ filenameVal = filename;
+ }
+
+ url = new URL("ftp://" + username + ":" + password + "@" + hostname + "/" + filenameVal);
+
+ final URLConnection connection;
+ connection = url.openConnection();
+ connection.setDoOutput(true);
+ final OutputStream os;
+ os = connection.getOutputStream();
+ try
+ {
+ final PrintStream ps = new PrintStream(os);
+ ps.print(contents);
+ ps.close();
+ }
+ finally
+
+ {
+ os.close();
+ }
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(FtpUnitTestCase.class, "ftp-test.esb");
+ }
+
+}
Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jca/JcaUnitTestCase.java (from rev 13654, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jca/unit/JcaUnitTestCase.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jca/JcaUnitTestCase.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jca/JcaUnitTestCase.java 2007-07-20 14:29:48 UTC (rev 13673)
@@ -0,0 +1,91 @@
+/*
+* 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.soa.esb.server.jca;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.server.StatsMBean;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Sample client for the jboss container.
+ *
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z scott.stark at jboss.org $
+ */
+
+public class JcaUnitTestCase
+ extends JBossTestCase
+{
+ org.jboss.logging.Logger log = getLog();
+
+ static boolean deployed = false;
+ static int test = 0;
+
+ public JcaUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void sendAMessage(String msg, String destination) throws Exception
+ {
+
+ InitialContext iniCtx = getInitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ ConnectionFactory qcf = (ConnectionFactory) tmp;
+ Connection conn = qcf.createConnection();
+ Destination que = (Queue) iniCtx.lookup(destination);
+ Session session = conn.createSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ MessageProducer send = session.createProducer(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ conn.close();
+ }
+
+ public void testSchemaBasedJcaGateway() throws Exception
+ {
+ sendAMessage("Hello World", "queue/esb_gateway_channel");
+ Thread.sleep(2000); // wait for message to post.
+ String version = (String)getServer().getAttribute(new ObjectName(StatsMBean.objectName), "ExecutedVersion");
+ assertEquals(version, "scope1");
+
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(JcaUnitTestCase.class, "jca-test.esb");
+ }
+
+}
Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/unit/SimpleDeployUnitTestCase.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/unit/SimpleDeployUnitTestCase.java 2007-07-20 13:11:27 UTC (rev 13672)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/unit/SimpleDeployUnitTestCase.java 2007-07-20 14:29:48 UTC (rev 13673)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.soa.esb.server.unit;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-
-import junit.framework.Test;
-
-import org.jboss.soa.esb.server.StatsMBean;
-import org.jboss.test.JBossTestCase;
-
-/**
- * Sample client for the jboss container.
- *
- * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
- * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z scott.stark at jboss.org $
- */
-
-public class SimpleDeployUnitTestCase
- extends JBossTestCase
-{
- org.jboss.logging.Logger log = getLog();
-
- static boolean deployed = false;
- static int test = 0;
-
- public SimpleDeployUnitTestCase(String name)
- {
- super(name);
- }
-
- public void sendAMessage(String msg, String destination) throws Exception
- {
-
- InitialContext iniCtx = getInitialContext();
- Object tmp = iniCtx.lookup("ConnectionFactory");
- ConnectionFactory qcf = (ConnectionFactory) tmp;
- Connection conn = qcf.createConnection();
- Destination que = (Queue) iniCtx.lookup(destination);
- Session session = conn.createSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- conn.start();
- MessageProducer send = session.createProducer(que);
- ObjectMessage tm = session.createObjectMessage(msg);
- send.send(tm);
- send.close();
- conn.close();
- }
-
- public void testSimple() throws Exception
- {
- sendAMessage("Hello World", "queue/esb_gateway_channel");
- Thread.sleep(2000); // wait for message to post.
- String version = (String)getServer().getAttribute(new ObjectName(StatsMBean.objectName), "ExecutedVersion");
- assertEquals(version, "scope1");
-
- }
-
- public void testScope() throws Exception
- {
- sendAMessage("Hello World", "queue/esb_gateway_channel_versioned");
- Thread.sleep(2000); // wait for message to post.
- String version = (String)getServer().getAttribute(new ObjectName(StatsMBean.objectName), "ExecutedVersion");
- assertEquals(version, "scope2");
-
- }
- public static Test suite() throws Exception
- {
- return getDeploySetup(SimpleDeployUnitTestCase.class, "simple.esb, simple-scoped.esb");
- }
-
-}
More information about the jboss-svn-commits
mailing list