[jboss-svn-commits] JBL Code SVN: r5541 - labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Aug 7 10:21:10 EDT 2006


Author: tfennelly
Date: 2006-08-07 10:21:05 -0400 (Mon, 07 Aug 2006)
New Revision: 5541

Added:
   labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationUnitTest
   labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerUnitTest.java
Removed:
   labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java
   labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java
Log:
renaming unit test files to *UnitTest so the ant script will pick them up in the test run

Deleted: labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java	2006-08-07 14:20:46 UTC (rev 5540)
+++ labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java	2006-08-07 14:21:05 UTC (rev 5541)
@@ -1,231 +0,0 @@
-/*
-* 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.services.EJB.test;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Hashtable;
-
-import javax.naming.InitialContext;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.Priority;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.common.tests.EJBContainerSetup;
-import org.jboss.soa.esb.helpers.DomElement;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
-import org.jboss.soa.esb.notification.NotificationList;
-import org.jboss.soa.esb.notification.NotificationTarget;
-import org.jboss.soa.esb.notification.NotifySqlTable;
-import org.jboss.soa.esb.services.EJB.NotificationHandler;
-
-
-public class NotificationTest extends BaseTest
-{
-	private Logger logger = Logger.getLogger(NotificationTest.class);
-	
-    public void testNotification()  {
-    	try {
-	    	logger.log(Priority.INFO, "Notification Test");
-	    	InitialContext ctx = getInitialContext();
-	        NotificationHandler local = (NotificationHandler ) ctx.lookup("NotificationHandlerBean/local");
-	        DomElement oEl = new DomElement("MyFileList");
-	        oEl.setAttr(NotificationList.TYPE,"OK");
-			
-	 //		oEl.addElemChild(fileListTarget());
-	 //		oEl.addElemChild(emailTarget());
-	 //		oEl.addElemChild(jmsQueueTarget());
-	 //		oEl.addElemChild(jmsTopicTarget());
-	         oEl.addElemChild(sqlTableTarget());
-			
-	         NotificationList oNL = new NotificationList(oEl);
-			
-	         // to see how the XML looks like
-	         // this is just a unit test class
-	         // Typically the XML is used in a parameter object (DomElement.fromXml())
-	         System.out.println(oNL.toString());
-
-	         // a simple timestamped message
-	         Date oNow = new Date(System.currentTimeMillis());
-	         SimpleDateFormat oStamp = new SimpleDateFormat("dd/MMM/yyyy HH:mm:ss.SSS");
-	         StringBuilder sb = new StringBuilder(oStamp.format(oNow))
-	             .append(" This message from Notification test");
-			
-	         //KS local.sendNotifications(oNL.toString(),sb.toString());
-	        
-    	} catch (Exception e) {
-    		logger.log(Priority.ERROR, e.getMessage(), e);
-    	}
-    }
-    
-    public void testKurt() {
-    	logger.log(Priority.INFO, "Test Kurt");
-    	
-    }
-
-    public static Test suite() {
-    	TestSuite suite = new TestSuite(NotificationTest.class);
-    	return new EJBContainerSetup(suite);
-    }
-    
-    public static InitialContext getInitialContext() throws Exception
-    {
-       Hashtable props = getInitialContextProperties();
-       return new InitialContext(props);
-    }
-    
-    private static Hashtable getInitialContextProperties()
-    {
-       Hashtable props = new Hashtable();
-       props.put("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
-       props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
-       return props;
-    }
-    
-//    static DomElement emailTarget() throws Exception
-//    {
-//        DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
-//        oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyEmail");
-//        oTgt.setAttr(Email.FROM,"sender at jboss.com");
-//        oTgt.setAttr(Email.SENDTO,"receiver1 at hotmail.com,receiver2 at jboss.com");;
-//        oTgt.setAttr(Email.SUBJECT,"TEST from Rosetta");
-//        oTgt.setAttr(Email.MESSAGE,"This is the text of your message");
-//		
-//        // This class does NOT send the e-mails, the app server does
-//        // consequently these paths would have to be accessible in the
-//        // application server (filesystem / mounts)
-//        String[] sa = {"/tmp/tomcat.sh","/tmp/program.js"};
-//        for (String sCurr : sa)
-//            oTgt.addTextChild(Email.ATTACH,sCurr);
-//
-//        return oTgt;
-//    } //________________________________
-//
-//    static DomElement fileListTarget() throws Exception
-//    {
-//        DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
-//        oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyFiles");
-//
-//        // This class does NOT write the files, the app server does
-//        // consequently these paths would have to be accessible in the
-//        // application server (filesystem / mounts)
-//        String[] sa = {"file:///tmp/file1.notif","file:///tmp/file2.notif"};
-//        for (String sCurr : sa)
-//        {	DomElement oFile = new DomElement(NotifyFiles.CHILD_FILE);
-//            oFile.setAttr(NotifyFiles.ATT_URI,sCurr);
-//            oFile.setAttr(NotifyFiles.ATT_APPEND,Boolean.toString(true));
-//            oTgt.addElemChild(oFile);
-//        }
-//        return oTgt;
-//    } //________________________________
-//
-//    static DomElement jmsQueueTarget() throws Exception
-//    {
-//        DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
-//        oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyQueues");
-//
-//        String[] sa = {"queue/A","queue/B"};
-//        for (String sCurr : sa)
-//        {	DomElement oQ = new DomElement(NotifyQueues.CHILD_QUEUE);
-//            oQ.setAttr(NotifyJMS.ATT_DEST_NAME,sCurr);
-//            for (DomElement oProp : getMessageProperties())
-//                oQ.addElemChild(oProp);
-//            oTgt.addElemChild(oQ);
-//        }
-//        return oTgt;
-//    } //________________________________
-//
-//    static DomElement jmsTopicTarget() throws Exception
-//    {
-//        DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
-//        oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyTopics");
-//
-//        String[] sa = {"topic/testTopic"};
-//        for (String sCurr : sa)
-//        {	DomElement oQ = new DomElement(NotifyTopics.CHILD_TOPIC);
-//            oQ.setAttr(NotifyJMS.ATT_DEST_NAME,sCurr);
-//            for (DomElement oProp : getMessageProperties())
-//                oQ.addElemChild(oProp);
-//            oTgt.addElemChild(oQ);
-//        }
-//        return oTgt;
-//    } //________________________________
-//
-//    static DomElement[] getMessageProperties() throws Exception
-//    {
-//        KeyValuePair[] oaProps = new KeyValuePair[]
-//        {new KeyValuePair("prop1","111")
-//        ,new KeyValuePair("prop2","bbb")
-//        ,new KeyValuePair("prop3","abc123")
-//        };
-//        DomElement[] oaRet = new DomElement[oaProps.length];
-//        int iCurr = 0;
-//        for (KeyValuePair oCurr : oaProps)
-//        {	DomElement oElem = new DomElement(NotifyJMS.CHILD_MSG_PROP);
-//            oElem.setAttr(NotifyJMS.ATT_PROP_NAME,oCurr.getKey());
-//            oElem.setAttr(NotifyJMS.ATT_PROP_VALUE,oCurr.getValue());
-//            oaRet[iCurr++] = oElem;
-//        }
-//        return oaRet;
-//    } //________________________________
-
-    static DomElement sqlTableTarget() throws Exception
-    {
-        DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
-        oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifySqlTable");
-
-        oTgt.setAttr(SimpleDataSource.DRIVER,"org.postgresql.Driver");
-        oTgt.setAttr(SimpleDataSource.URL,"jdbc:postgresql://localhost:5432/jbossesb");
-        oTgt.setAttr(SimpleDataSource.USER,"postgres");
-        oTgt.setAttr(SimpleDataSource.PASSWORD,"postgres");
-		
-        // Table name for insert - must exist in database (URL)
-        oTgt.setAttr(NotifySqlTable.ATT_TABLE,"test_notif_table");
-        // Column that will contain the dynamic data generated by the ActionClass
-        // must exist in table (ATT_TABLE above)
-        oTgt.setAttr(NotifySqlTable.ATT_DATA,"msg");
-		
-        // constant data that can be also added in the insert
-        // (perhaps needed for queries)
-        // Key = column name (it must exist in the table, same as ATT_DATA column)
-        KeyValuePair[] oaCols = new KeyValuePair[]
-          {new KeyValuePair("src","TestNotification")
-          ,new KeyValuePair("ref","any Ref")
-          ,new KeyValuePair("val1","VVVV 11111")
-          };
-        for (KeyValuePair oCurr : oaCols)
-        {	DomElement oElem = new DomElement(NotifySqlTable.CHILD_COLUMN);
-            oElem.setAttr(NotifySqlTable.ATT_NAME,oCurr.getKey());
-            oElem.setAttr(NotifySqlTable.ATT_VALUE,oCurr.getValue());
-            oTgt.addElemChild(oElem);
-        }
-		
-        return oTgt;
-    }
-
-}
-
-   

Copied: labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationUnitTest (from rev 5537, labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java)

Deleted: labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java	2006-08-07 14:20:46 UTC (rev 5540)
+++ labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java	2006-08-07 14:21:05 UTC (rev 5541)
@@ -1,63 +0,0 @@
-/*
-* 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.services.EJB.test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.apache.log4j.Logger;
-import org.apache.log4j.Priority;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.common.tests.EJBContainerSetup;
-import org.jboss.soa.esb.services.EJB.PersistHandler;
-
-
-public class PersistHandlerTest extends BaseTest
-{
-	private Logger logger = Logger.getLogger(PersistHandlerTest.class);
-	
-    public void testConnectivityToPersistHandler()  {
-    	try {
-	    	logger.log(Priority.INFO, "PersistHandler Test");
-	    	PersistHandler persistHandlerLocal = (PersistHandler ) EJBContainerSetup.lookup("PersistHandlerBean/remote");
-	    	logger.log(Priority.INFO, "persistHandlerLocal=" + persistHandlerLocal);
-	    	persistHandlerLocal.create();
-	    	persistHandlerLocal.addDTO(null);
-    	} catch (Exception e) {
-    		logger.log(Priority.ERROR, e.getMessage(), e);
-    	}
-    }
-    
-    public void testKurt() {
-    	logger.log(Priority.INFO, "Test Kurt");
-    	
-    }
-
-    public static Test suite() {
-    	TestSuite suite = new TestSuite(PersistHandlerTest.class);
-    	return new EJBContainerSetup(suite);
-    }
-    
-
-    
-}
-
-   

Copied: labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerUnitTest.java (from rev 5536, labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java)




More information about the jboss-svn-commits mailing list