[jboss-svn-commits] JBL Code SVN: r5485 - 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
Fri Aug 4 20:14:50 EDT 2006
Author: kurt.stam at jboss.com
Date: 2006-08-04 20:14:49 -0400 (Fri, 04 Aug 2006)
New Revision: 5485
Removed:
labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationFuncTest.java
Log:
removing duplicate test
Deleted: labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationFuncTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationFuncTest.java 2006-08-05 00:00:32 UTC (rev 5484)
+++ labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationFuncTest.java 2006-08-05 00:14:49 UTC (rev 5485)
@@ -1,221 +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.util.*;
-import java.text.SimpleDateFormat;
-
-import org.jboss.soa.esb.common.SystemProperties;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.common.tests.EJBContainerSetup;
-import org.jboss.soa.esb.helpers.*;
-import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
-import org.jboss.soa.esb.notification.*;
-import org.jboss.soa.esb.services.InotificationHandler;
-import org.jboss.soa.esb.services.Zap;
-
-// DON'T FORGET !!
-// The Rosetta Application server has to be up and running
-// (set JNDI_SERVER appropriately)
-// For e-mail notification: System properties for smtp
-// (server, user, password, port) must be set up in app server
-
-public class NotificationFuncTest extends BaseTest
-{
- private static InotificationHandler m_oH;
-
- public void setUp(){
- EJBContainerSetup.startupEmbeddedJboss();
- }
-
- public NotificationFuncTest() {
- }
-
- public void testNotImplementedFuncTest() {
- log.info("*******************************************");
- log.info("Requires Implementation");
- log.info("*******************************************");
- new Zap();
- }
-
- /*
- public NotificationFuncTest () throws Exception
- { performTest(); }
-
- static void performTest() throws Exception
- {
- // get a handle to your business delegate
- m_oH = NotificationHandlerFactory.getNotifHandler
- ("remote"
- ,SystemProperties.getJndiServerType()
- ,SystemProperties.getJndiServerURL()
- );
-
- 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");
-
- m_oH.sendNotifications(oNL,sb.toString());
- } //________________________________
-
- static DomElement emailTarget() throws Exception
- {
- DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
- oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyEmail");
- oTgt.setAttr(EsbEmail.FROM,"sender at jboss.com");
- oTgt.setAttr(EsbEmail.SENDTO,"receiver1 at hotmail.com,receiver2 at jboss.com");;
- oTgt.setAttr(EsbEmail.SUBJECT,"TEST from Rosetta");
- oTgt.setAttr(EsbEmail.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(EsbEmail.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://lavasca:5432/rosetta");
- oTgt.setAttr(SimpleDataSource.USER,"postgres");
- oTgt.setAttr(SimpleDataSource.PASSWORD,"");
-
- // 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;
- } //________________________________
-
- */
-} //____________________________________________________________________________
More information about the jboss-svn-commits
mailing list