You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/06/14 23:14:49 UTC
svn commit: r190657 [3/23] - in /incubator/beehive/trunk/system-controls: ./
ant/ samples/ejb/
samples/ejb/client/org/apache/beehive/controls/system/ejb/sample/client/
samples/ejb/control/org/apache/beehive/controls/system/ejb/sample/control/
samples/ejb/ejb/META-INF/
samples/ejb/ejb/org/apache/beehive/controls/system/ejb/sample/bean/
samples/jdbc/jdbcControlSample/ samples/jdbc/jdbcControlSample/META-INF/
samples/jdbc/jdbcControlSample/WEB-INF/
samples/jdbc/jdbcControlSample/WEB-INF/src/
samples/jdbc/jdbcControlSample/WEB-INF/src/controls/
samples/jdbc/jdbcControlSample/WEB-INF/src/servlet/
samples/jdbc/jdbcControlSample/WEB-INF/src/shared/ samples/jms/
samples/jms/src/org/apache/beehive/controls/system/jms/samples/
samples/webservice/amazon/ samples/webservice/amazon/junit/
samples/webservice/amazon/schemas/ samples/webservice/common/src/test/
samples/webservice/google/ samples/webservice/google/junit/model/
samples/webservice/google/rpc_schemas/ samples/webservice/google/servlet/
samples/webservice/wsm_samples_client/
samples/webservice/wsm_samples_client/junit/
samples/webservice/wsm_samples_client/junit/org/wsm/samples/client/header/
samples/webservice/wsm_samples_client/junit/org/wsm/samples/client/webparam/
samples/webservice/xmlbeans/ samples/webservice/xmlbeans/junit/ src/ejb/
src/ejb/org/apache/beehive/controls/system/ejb/ src/ejb/schema/ src/jdbc/
src/jdbc/org/apache/beehive/controls/system/jdbc/
src/jdbc/org/apache/beehive/controls/system/jdbc/parser/ src/jms/
src/jms/org/apache/beehive/controls/system/jms/
src/jms/org/apache/beehive/controls/system/jms/impl/
src/jms/org/apache/beehive/controls/system/jndi/
src/jms/org/apache/beehive/controls/system/jndi/impl/ src/webservice/
src/webservice/org/apache/beehive/controls/system/webservice/
src/webservice/org/apache/beehive/controls/system/webservice/generator/
src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/
src/webservice/org/apache/beehive/controls/system/webservice/utils/
test/ant/ test/conf/ test/src/jdbc/controls/
test/src/jdbc/controls/org/apache/beehive/controls/system/jdbc/test/dbconnection/
test/src/jdbc/controls/org/apache/beehive/controls/system/jdbc/test/errors/
test/src/jdbc/controls/org/apache/beehive/controls/system/jdbc/test/results/
test/src/jdbc/controls/schemas/badusers/
test/src/jdbc/controls/schemas/users/ test/src/jdbc/jdbc-container/
test/src/jdbc/jdbc-container/application/
test/src/jdbc/jdbc-container/src/org/apache/beehive/controls/system/jdbc/containertest/
test/src/jdbc/jdbc-container/webapp/WEB-INF/
test/src/jdbc/jdbc-container/webapp/conf/Catalina/localhost/
test/src/jdbc/junitTests/
test/src/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/dbconnection/
test/src/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/errors/
test/src/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/results/
test/src/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/sqlparser/
test/src/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/utils/
test/src/webservice/ test/src/webservice/jcxgen-tests/
test/src/webservice/jcxgen-tests/tests/org/apache/beehive/controls/system/webservice/units/jcxgen/
test/src/webservice/schemas/ test/src/webservice/servers/webapp/WEB-INF/
test/src/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/doclitwrap/
test/src/webservice/servers/webapp/WEB-INF/src/web/
test/src/webservice/servers/webapp/WEB-INF/webservices/web/complex/
test/src/webservice/tests/org/apache/beehive/controls/system/webservice/units/dlwservice/
Modified: incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/error.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/error.jsp?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/error.jsp (original)
+++ incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/error.jsp Tue Jun 14 14:14:42 2005
@@ -1,69 +1,69 @@
-<%@ page language="java" contentType="text/html;charset=UTF-8"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
-<netui:html>
- <head>
- <title>NetUI Error</title>
- <style>
- table {
- border: solid 1pt #90180F;
- background-color: #ffffff;
- }
- body {
- margin: 20pt 5%;
- background-color: #fdf4b6;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 10pt;
- }
- .caption {
- font-weight: bold;
- font-size: 20pt;
- text-align: left;
- width: 500px
- }
- th {vertical-align: top;
- text-align: right;
- font-size: 12pt;
- color: #90180F;
- width: 100px;
- }
- td {
- text-align: left;
- }
- hr {
- color: #90180F;
- }
- .posTitle {
- position: relative;
- color: #6C0C06;
- left: -160pt;
- top: -12pt;
- }
- .pfErrorLineOne {
- color: red;
- font-size: 12pt;
- font-style: italic;
- }
- img {
- border: solid 2pt #90180F;
- }
- </style>
- <netui:base/>
- </head>
- <netui:body>
- <div class="caption">
- <netui:image src="${pageContext.request.contextPath}/resources/beehive/version1/images/error-header.jpg" width="338" height="96" alt="Page Flow Error"/>
- <span class="posTitle">NetUI Error</span>
- </div>
- <table border="0" cellspacing='0' cellpadding='4'>
- <c:if test="${request.errorMessage != null}">
- <tr><th>Message:</th><td class="pfErrorLineOne"><netui:label value="${request.errorMessage}" defaultValue=" "/></td></tr>
- </c:if>
- <tr><th>Exception:</th><td class="pfErrorLineOne"><netui:exceptions showMessage="true"/></td></tr>
- <tr><td colspan="2" style="min-width:342"><hr></td></tr>
- <tr><th>Stack Trace:</th><td><netui:exceptions showMessage="false" showDevModeStackTrace="true"/></td></tr>
- </table>
- </netui:body>
-</netui:html>
-<%-- Some browsers will not display this page unless the response status code is 200. --%>
-<% response.setStatus(200); %>
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<netui:html>
+ <head>
+ <title>NetUI Error</title>
+ <style>
+ table {
+ border: solid 1pt #90180F;
+ background-color: #ffffff;
+ }
+ body {
+ margin: 20pt 5%;
+ background-color: #fdf4b6;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ }
+ .caption {
+ font-weight: bold;
+ font-size: 20pt;
+ text-align: left;
+ width: 500px
+ }
+ th {vertical-align: top;
+ text-align: right;
+ font-size: 12pt;
+ color: #90180F;
+ width: 100px;
+ }
+ td {
+ text-align: left;
+ }
+ hr {
+ color: #90180F;
+ }
+ .posTitle {
+ position: relative;
+ color: #6C0C06;
+ left: -160pt;
+ top: -12pt;
+ }
+ .pfErrorLineOne {
+ color: red;
+ font-size: 12pt;
+ font-style: italic;
+ }
+ img {
+ border: solid 2pt #90180F;
+ }
+ </style>
+ <netui:base/>
+ </head>
+ <netui:body>
+ <div class="caption">
+ <netui:image src="${pageContext.request.contextPath}/resources/beehive/version1/images/error-header.jpg" width="338" height="96" alt="Page Flow Error"/>
+ <span class="posTitle">NetUI Error</span>
+ </div>
+ <table border="0" cellspacing='0' cellpadding='4'>
+ <c:if test="${request.errorMessage != null}">
+ <tr><th>Message:</th><td class="pfErrorLineOne"><netui:label value="${request.errorMessage}" defaultValue=" "/></td></tr>
+ </c:if>
+ <tr><th>Exception:</th><td class="pfErrorLineOne"><netui:exceptions showMessage="true"/></td></tr>
+ <tr><td colspan="2" style="min-width:342"><hr></td></tr>
+ <tr><th>Stack Trace:</th><td><netui:exceptions showMessage="false" showDevModeStackTrace="true"/></td></tr>
+ </table>
+ </netui:body>
+</netui:html>
+<%-- Some browsers will not display this page unless the response status code is 200. --%>
+<% response.setStatus(200); %>
Propchange: incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/error.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/index.jsp?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/index.jsp (original)
+++ incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/index.jsp Tue Jun 14 14:14:42 2005
@@ -1,16 +1,16 @@
-<%@ page language="java" contentType="text/html;charset=UTF-8"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
-<netui:html>
- <head>
- <title>Sample JdbcControl Page</title>
- <netui:base/>
- </head>
- <netui:body>
- <p>
- Sample JdbcControl Page
- <netui:anchor action="startDemo">Start Demo</netui:anchor>
- </p>
- </netui:body>
-</netui:html>
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<netui:html>
+ <head>
+ <title>Sample JdbcControl Page</title>
+ <netui:base/>
+ </head>
+ <netui:body>
+ <p>
+ Sample JdbcControl Page
+ <netui:anchor action="startDemo">Start Demo</netui:anchor>
+ </p>
+ </netui:body>
+</netui:html>
Propchange: incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/index.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/sql.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/sql.jsp?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/sql.jsp (original)
+++ incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/sql.jsp Tue Jun 14 14:14:42 2005
@@ -1,59 +1,59 @@
-<%@ page language="java" contentType="text/html;charset=UTF-8"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
-<%@ page import="java.sql.*,javax.naming.*,javax.sql.*" %>
-<html>
- <head>
- <title>SQL on Tomcat Test</title>
- </head>
- <body>
- <p>
- <b>SQL on Tomcat Test</b>
-
-<%
- Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
-
- Context ctx = new InitialContext();
- if(ctx == null)
- throw new RuntimeException("Could not create an InitialContext");
-
- DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/TestDB");
- if(ds == null)
- throw new RuntimeException("Could not create a DataSource");
- out.write("<br/>found ds: " + ds + "<br/>");
-
- Connection conn = ds.getConnection();
- if(conn == null)
- throw new RuntimeException("Could not get database connection");
- out.write("got here</br>");
-
- java.sql.Statement stmt = conn.createStatement();
- try {
- stmt.execute("drop table CATEGORIES");
- stmt.close();
- } catch(Exception ignore) {ignore.printStackTrace(); stmt.close();}
- stmt = conn.createStatement();
- boolean result = stmt.execute(
- "CREATE TABLE Categories (CategoryID int GENERATED ALWAYS AS IDENTITY, CategoryName varchar (15) NOT NULL, Description CLOB (2K), CONSTRAINT PK_Categories PRIMARY KEY(CategoryID))");
- out.write("result: " + result);
- stmt.close();
-
- stmt = conn.createStatement();
- stmt.execute("insert into categories (CategoryName,Description) VALUES('Beverages','Soft drinks, coffees, teas, beers, and ales')");
- stmt.close();
-
- stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("select * from categories");
- pageContext.setAttribute("rs", rs);
- while(rs.next()) {
- out.write("name: " + rs.getObject("categoryname") + "<br/>");
- out.write("name: " + rs.getObject("description") + "<br/>");
- }
- rs.close();
- stmt.close();
- conn.close();
-%>
- </p>
- </body>
-</html>
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ page import="java.sql.*,javax.naming.*,javax.sql.*" %>
+<html>
+ <head>
+ <title>SQL on Tomcat Test</title>
+ </head>
+ <body>
+ <p>
+ <b>SQL on Tomcat Test</b>
+
+<%
+ Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+
+ Context ctx = new InitialContext();
+ if(ctx == null)
+ throw new RuntimeException("Could not create an InitialContext");
+
+ DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/TestDB");
+ if(ds == null)
+ throw new RuntimeException("Could not create a DataSource");
+ out.write("<br/>found ds: " + ds + "<br/>");
+
+ Connection conn = ds.getConnection();
+ if(conn == null)
+ throw new RuntimeException("Could not get database connection");
+ out.write("got here</br>");
+
+ java.sql.Statement stmt = conn.createStatement();
+ try {
+ stmt.execute("drop table CATEGORIES");
+ stmt.close();
+ } catch(Exception ignore) {ignore.printStackTrace(); stmt.close();}
+ stmt = conn.createStatement();
+ boolean result = stmt.execute(
+ "CREATE TABLE Categories (CategoryID int GENERATED ALWAYS AS IDENTITY, CategoryName varchar (15) NOT NULL, Description CLOB (2K), CONSTRAINT PK_Categories PRIMARY KEY(CategoryID))");
+ out.write("result: " + result);
+ stmt.close();
+
+ stmt = conn.createStatement();
+ stmt.execute("insert into categories (CategoryName,Description) VALUES('Beverages','Soft drinks, coffees, teas, beers, and ales')");
+ stmt.close();
+
+ stmt = conn.createStatement();
+ ResultSet rs = stmt.executeQuery("select * from categories");
+ pageContext.setAttribute("rs", rs);
+ while(rs.next()) {
+ out.write("name: " + rs.getObject("categoryname") + "<br/>");
+ out.write("name: " + rs.getObject("description") + "<br/>");
+ }
+ rs.close();
+ stmt.close();
+ conn.close();
+%>
+ </p>
+ </body>
+</html>
Propchange: incubator/beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/sql.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/beehive/trunk/system-controls/samples/jms/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/ControlTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/ControlTestCase.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/ControlTestCase.java (original)
+++ incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/ControlTestCase.java Tue Jun 14 14:14:42 2005
@@ -1,134 +1,134 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-package org.apache.beehive.controls.system.jms.samples;
-
-
-import java.beans.Beans;
-import java.lang.reflect.Method;
-
-import junit.framework.TestCase;
-
-import org.apache.beehive.controls.api.bean.ControlBean;
-import org.apache.beehive.controls.api.context.ControlBeanContext;
-import org.apache.beehive.controls.api.context.ControlThreadContext;
-import org.apache.beehive.controls.api.context.ControlContainerContext;
-
-
-/**
- * An test case that handles establishing a bean context
- * if there isn't one and providing methods instantiating controls by name
- * via proper channels (@see Beans.instantiate) and adding/removing
- * them.
- */
-public abstract class ControlTestCase extends TestCase
-{
- /* Public Constructor(s) */
- /**
- * Contstruct a test-case with the given name.
- * @param name the name of the test case.
- */
- public ControlTestCase(String name) throws Exception
- {
- super(name);
- }
- /* Public Method(s) */
- /**
- * @see TestCase#setUp
- */
- public void setUp() throws Exception
- {
- _embeddedContext = ControlThreadContext.getContext();
- if(_embeddedContext == null)
- {
- _embeddedContext = _cntxt = new DefaultContainerContext();
- _cntxt.beginContext();
- }
- initializeAsClient(this);
- }
- /**
- * @see TestCase#tearDown
- */
- public void tearDown() throws Exception
- {
- if(_cntxt != null)
- {
- _cntxt.endContext();
- }
- }
- /* Protected Method(s) */
- /**
- * Instantiate the control with the given name and add
- * it to the current bean-context.
- * @param name the fully-qualified name of the control.
- */
- protected ControlBean instantiateControl(String name) throws Exception
- {
- ControlBean bean = (ControlBean)Beans.instantiate(Thread.currentThread().getContextClassLoader(),
- name,_embeddedContext);
- initializeAsClient(bean);
- return bean;
- }
- /**
- * Remove the given control from the current bean-context.
- * @param bean
- */
- protected void freeControl(ControlBean bean)
- {
- if(bean != null)
- {
- _embeddedContext.remove(bean);
- }
- }
- /**
- * Initialize this junit as a control client.
- */
- protected void initializeAsClient(Object obj)
- {
- if(_cntxt == null)
- {
- return;
- }
- Class cls = obj.getClass();
- while(cls != null && cls != ControlTestCase.class && cls != Object.class)
- {
- String init = cls.getName()+CLASS_ClientInitializer;
- try
- {
- Class clazz = Thread.currentThread().getContextClassLoader().loadClass(init);
- Object initializer = cls.newInstance();
- Method m = clazz.getMethod(METHOD_Initialize,new Class[] {ControlBeanContext.class,cls });
- m.invoke(initializer,new Object[] { _cntxt ,this } );
-
- }
- catch(Exception e)
- {
-
- }
- cls = cls.getSuperclass();
- }
- }
- /* Private Constant(s) */
- final private static String CLASS_ClientInitializer = "ClientInitializer";
- final private static String METHOD_Initialize = "initialize";
-
- /* Private Field(s) */
- /* The current context. */
- private ControlContainerContext _embeddedContext;
- /* The default context if one didn't exist */
- private ControlContainerContext _cntxt;
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.system.jms.samples;
+
+
+import java.beans.Beans;
+import java.lang.reflect.Method;
+
+import junit.framework.TestCase;
+
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.context.ControlThreadContext;
+import org.apache.beehive.controls.api.context.ControlContainerContext;
+
+
+/**
+ * An test case that handles establishing a bean context
+ * if there isn't one and providing methods instantiating controls by name
+ * via proper channels (@see Beans.instantiate) and adding/removing
+ * them.
+ */
+public abstract class ControlTestCase extends TestCase
+{
+ /* Public Constructor(s) */
+ /**
+ * Contstruct a test-case with the given name.
+ * @param name the name of the test case.
+ */
+ public ControlTestCase(String name) throws Exception
+ {
+ super(name);
+ }
+ /* Public Method(s) */
+ /**
+ * @see TestCase#setUp
+ */
+ public void setUp() throws Exception
+ {
+ _embeddedContext = ControlThreadContext.getContext();
+ if(_embeddedContext == null)
+ {
+ _embeddedContext = _cntxt = new DefaultContainerContext();
+ _cntxt.beginContext();
+ }
+ initializeAsClient(this);
+ }
+ /**
+ * @see TestCase#tearDown
+ */
+ public void tearDown() throws Exception
+ {
+ if(_cntxt != null)
+ {
+ _cntxt.endContext();
+ }
+ }
+ /* Protected Method(s) */
+ /**
+ * Instantiate the control with the given name and add
+ * it to the current bean-context.
+ * @param name the fully-qualified name of the control.
+ */
+ protected ControlBean instantiateControl(String name) throws Exception
+ {
+ ControlBean bean = (ControlBean)Beans.instantiate(Thread.currentThread().getContextClassLoader(),
+ name,_embeddedContext);
+ initializeAsClient(bean);
+ return bean;
+ }
+ /**
+ * Remove the given control from the current bean-context.
+ * @param bean
+ */
+ protected void freeControl(ControlBean bean)
+ {
+ if(bean != null)
+ {
+ _embeddedContext.remove(bean);
+ }
+ }
+ /**
+ * Initialize this junit as a control client.
+ */
+ protected void initializeAsClient(Object obj)
+ {
+ if(_cntxt == null)
+ {
+ return;
+ }
+ Class cls = obj.getClass();
+ while(cls != null && cls != ControlTestCase.class && cls != Object.class)
+ {
+ String init = cls.getName()+CLASS_ClientInitializer;
+ try
+ {
+ Class clazz = Thread.currentThread().getContextClassLoader().loadClass(init);
+ Object initializer = cls.newInstance();
+ Method m = clazz.getMethod(METHOD_Initialize,new Class[] {ControlBeanContext.class,cls });
+ m.invoke(initializer,new Object[] { _cntxt ,this } );
+
+ }
+ catch(Exception e)
+ {
+
+ }
+ cls = cls.getSuperclass();
+ }
+ }
+ /* Private Constant(s) */
+ final private static String CLASS_ClientInitializer = "ClientInitializer";
+ final private static String METHOD_Initialize = "initialize";
+
+ /* Private Field(s) */
+ /* The current context. */
+ private ControlContainerContext _embeddedContext;
+ /* The default context if one didn't exist */
+ private ControlContainerContext _cntxt;
+}
Propchange: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/ControlTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/DefaultContainerContext.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/DefaultContainerContext.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/DefaultContainerContext.java (original)
+++ incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/DefaultContainerContext.java Tue Jun 14 14:14:42 2005
@@ -1,62 +1,62 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-package org.apache.beehive.controls.system.jms.samples;
-
-
-import java.io.IOException;
-
-import org.apache.beehive.controls.api.ControlException;
-import org.apache.beehive.controls.api.context.ControlHandle;
-import org.apache.beehive.controls.api.bean.ControlBean;
-import org.apache.beehive.controls.runtime.bean.ControlContainerContext;
-import org.apache.beehive.controls.runtime.bean.ControlBeanContext;
-
-
-
-
-
-/**
- * The DefaultContainerContext provides a ControlContainerContext implementation to be used
- * for simple testing of controls.
- */
-public class DefaultContainerContext extends ControlContainerContext
-{
-
- /* Public Constructor(s) */
- /**
- * Construct a container-context for a standalone
- * application use.
- */
- public DefaultContainerContext()
- {
- super();
- }
- /* Public Method(s) */
-
- /**
- * @see ControlContainerContext#getControlHandle(org.apache.beehive.controls.runtime.bean.ControlBean)
- */
- public ControlHandle getControlHandle(ControlBean bean)
- {
- return new DefaultControlHandle(this,bean);
- }
-
- /* Private Constant(s) */
- private static final long serialVersionUID = -7967007783133727017L;
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.system.jms.samples;
+
+
+import java.io.IOException;
+
+import org.apache.beehive.controls.api.ControlException;
+import org.apache.beehive.controls.api.context.ControlHandle;
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.runtime.bean.ControlContainerContext;
+import org.apache.beehive.controls.runtime.bean.ControlBeanContext;
+
+
+
+
+
+/**
+ * The DefaultContainerContext provides a ControlContainerContext implementation to be used
+ * for simple testing of controls.
+ */
+public class DefaultContainerContext extends ControlContainerContext
+{
+
+ /* Public Constructor(s) */
+ /**
+ * Construct a container-context for a standalone
+ * application use.
+ */
+ public DefaultContainerContext()
+ {
+ super();
+ }
+ /* Public Method(s) */
+
+ /**
+ * @see ControlContainerContext#getControlHandle(org.apache.beehive.controls.runtime.bean.ControlBean)
+ */
+ public ControlHandle getControlHandle(ControlBean bean)
+ {
+ return new DefaultControlHandle(this,bean);
+ }
+
+ /* Private Constant(s) */
+ private static final long serialVersionUID = -7967007783133727017L;
+
+}
Propchange: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/DefaultContainerContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/DefaultControlHandle.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/DefaultControlHandle.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/DefaultControlHandle.java (original)
+++ incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/DefaultControlHandle.java Tue Jun 14 14:14:42 2005
@@ -1,114 +1,114 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-package org.apache.beehive.controls.system.jms.samples;
-
-import java.io.Serializable;
-import java.lang.reflect.InvocationTargetException;
-
-import org.apache.beehive.controls.api.context.ControlHandle;
-import org.apache.beehive.controls.api.context.ControlThreadContext;
-import org.apache.beehive.controls.api.events.EventRef;
-import org.apache.beehive.controls.api.bean.ControlBean;
-import org.apache.beehive.controls.api.context.ControlContainerContext;
-
-/**
- * A control-handle used for simple invokation/event support.
- */
-public class DefaultControlHandle implements ControlHandle, Serializable
-{
- /** Public Constructor(s) */
- /**
- * Default constructor (used by serialization).
- */
- public DefaultControlHandle()
- {
-
- }
-
- /**
- * Construct a simple-control handle.
- *
- * @param context
- * The control-container-context.
- * @param bean
- * the control bean.
- */
- public DefaultControlHandle(ControlContainerContext context,
- ControlBean bean)
- {
- _context = context;
- _controlId = bean.getControlID();
- _controlInterface = bean.getControlInterface().getName();
- _controlBean = bean.getClass().getName();
- }
-
- /** Public Method(s) */
- /**
- * @see org.apache.beehive.controls.api.context.ControlHandle#getControlID()
- */
- public String getControlID()
- {
- return _controlId;
- }
-
- /**
- * @see org.apache.beehive.controls.api.context.ControlHandle#sendEvent(org.apache.beehive.controls.api.events.EventRef,
- * java.lang.Object[])
- */
- public Object sendEvent(EventRef event, Object[] args)
- throws IllegalAccessException, IllegalArgumentException,
- InvocationTargetException
- {
- if(_context == null)
- {
- _context = ControlThreadContext.getContext();
- }
- if(_context == null)
- {
- throw new IllegalArgumentException("No container context to send event to");
- }
- try
- {
- //
- // Push the test context, to simulate re-entering the container
- //
- _context.beginContext();
-
- return _context.dispatchEvent(this, event, args);
- } finally
- {
- _context.endContext();
- }
- }
-
- private static final long serialVersionUID = 1928410200080675302L;
-
- /* Private Field(s) */
- /** The control-id of the control. */
- private String _controlId;
-
- /** The interface class of the control. */
- private String _controlInterface;
-
- /** The bean class of the control. */
- private String _controlBean;
-
- /** The control container context */
- private transient ControlContainerContext _context;
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.system.jms.samples;
+
+import java.io.Serializable;
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.beehive.controls.api.context.ControlHandle;
+import org.apache.beehive.controls.api.context.ControlThreadContext;
+import org.apache.beehive.controls.api.events.EventRef;
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.api.context.ControlContainerContext;
+
+/**
+ * A control-handle used for simple invokation/event support.
+ */
+public class DefaultControlHandle implements ControlHandle, Serializable
+{
+ /** Public Constructor(s) */
+ /**
+ * Default constructor (used by serialization).
+ */
+ public DefaultControlHandle()
+ {
+
+ }
+
+ /**
+ * Construct a simple-control handle.
+ *
+ * @param context
+ * The control-container-context.
+ * @param bean
+ * the control bean.
+ */
+ public DefaultControlHandle(ControlContainerContext context,
+ ControlBean bean)
+ {
+ _context = context;
+ _controlId = bean.getControlID();
+ _controlInterface = bean.getControlInterface().getName();
+ _controlBean = bean.getClass().getName();
+ }
+
+ /** Public Method(s) */
+ /**
+ * @see org.apache.beehive.controls.api.context.ControlHandle#getControlID()
+ */
+ public String getControlID()
+ {
+ return _controlId;
+ }
+
+ /**
+ * @see org.apache.beehive.controls.api.context.ControlHandle#sendEvent(org.apache.beehive.controls.api.events.EventRef,
+ * java.lang.Object[])
+ */
+ public Object sendEvent(EventRef event, Object[] args)
+ throws IllegalAccessException, IllegalArgumentException,
+ InvocationTargetException
+ {
+ if(_context == null)
+ {
+ _context = ControlThreadContext.getContext();
+ }
+ if(_context == null)
+ {
+ throw new IllegalArgumentException("No container context to send event to");
+ }
+ try
+ {
+ //
+ // Push the test context, to simulate re-entering the container
+ //
+ _context.beginContext();
+
+ return _context.dispatchEvent(this, event, args);
+ } finally
+ {
+ _context.endContext();
+ }
+ }
+
+ private static final long serialVersionUID = 1928410200080675302L;
+
+ /* Private Field(s) */
+ /** The control-id of the control. */
+ private String _controlId;
+
+ /** The interface class of the control. */
+ private String _controlInterface;
+
+ /** The bean class of the control. */
+ private String _controlBean;
+
+ /** The control container context */
+ private transient ControlContainerContext _context;
+
+}
Propchange: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/DefaultControlHandle.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/OrderQueue.jcx
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/OrderQueue.jcx?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/OrderQueue.jcx (original)
+++ incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/OrderQueue.jcx Tue Jun 14 14:14:42 2005
@@ -1,59 +1,59 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-package org.apache.beehive.controls.system.jms.samples;
-
-import java.util.Date;
-
-import org.apache.beehive.controls.api.bean.ControlExtension;
-import org.apache.beehive.controls.system.jms.JMSControl;
-
-
-@ControlExtension
-@JMSControl.Destination(sendJndiName="jms.SimpleJmsQ",jndiConnectionFactory="weblogic.jws.jms.QueueConnectionFactory")
-public interface OrderQueue extends JMSControl
-{
- /**
- * Represents a simple order.
- */
- public class Order implements java.io.Serializable
- {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 8951994251593378324L;
- public Order()
- {
-
- }
- public Order(int buyer,String[] list)
- {
- buyerId = buyer;
- itemList = list;
-
- }
- private int buyerId;
- private String[] itemList;
- }
- /**
- * Submit an order with the given deliverBy and type.
- * @param order the order to be submitted.
- * @param deliverBy the deliver by date.
- * @return the JMS message sent.
- */
- public javax.jms.Message submitOrder(Order order,@Property(name="DeliverBy") Date deliverBy);
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.system.jms.samples;
+
+import java.util.Date;
+
+import org.apache.beehive.controls.api.bean.ControlExtension;
+import org.apache.beehive.controls.system.jms.JMSControl;
+
+
+@ControlExtension
+@JMSControl.Destination(sendJndiName="jms.SimpleJmsQ",jndiConnectionFactory="weblogic.jws.jms.QueueConnectionFactory")
+public interface OrderQueue extends JMSControl
+{
+ /**
+ * Represents a simple order.
+ */
+ public class Order implements java.io.Serializable
+ {
+ /**
+ * Comment for <code>serialVersionUID</code>
+ */
+ private static final long serialVersionUID = 8951994251593378324L;
+ public Order()
+ {
+
+ }
+ public Order(int buyer,String[] list)
+ {
+ buyerId = buyer;
+ itemList = list;
+
+ }
+ private int buyerId;
+ private String[] itemList;
+ }
+ /**
+ * Submit an order with the given deliverBy and type.
+ * @param order the order to be submitted.
+ * @param deliverBy the deliver by date.
+ * @return the JMS message sent.
+ */
+ public javax.jms.Message submitOrder(Order order,@Property(name="DeliverBy") Date deliverBy);
+}
Propchange: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/OrderQueue.jcx
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/SampleQueue.jcx
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/SampleQueue.jcx?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/SampleQueue.jcx (original)
+++ incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/SampleQueue.jcx Tue Jun 14 14:14:42 2005
@@ -1,50 +1,50 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-package org.apache.beehive.controls.system.jms.samples;
-
-import java.util.Date;
-
-import org.apache.beehive.controls.api.bean.ControlExtension;
-import org.apache.beehive.controls.system.jms.JMSControl;
-import org.apache.xmlbeans.XmlObject;
-
-@ControlExtension
-@JMSControl.Destination(sendJndiName="jms.SampleQueue",jndiConnectionFactory="weblogic.jws.jms.QueueConnectionFactory")
-public interface SampleQueue extends JMSControl
-{
- /**
- * Submit an xml object (org.apache.xmlbeans) as a text message.
- * @param document the document.
- * @param type the message JMS type.
- */
- public void submitXml(XmlObject document,@Type String type);
-
- /**
- * Submit an xml object (org.apache.xmlbeans) with JMS type "xmlObject".
- * @param document the document.
- */
- @Message(MessageType.Text)
- @Type("xmlObject")
- public void submitXml(XmlObject document);
-
- /**
- * Submit an already constructed message
- * @param message the jms-message.
- */
- public void submitMessage(Message message);
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.system.jms.samples;
+
+import java.util.Date;
+
+import org.apache.beehive.controls.api.bean.ControlExtension;
+import org.apache.beehive.controls.system.jms.JMSControl;
+import org.apache.xmlbeans.XmlObject;
+
+@ControlExtension
+@JMSControl.Destination(sendJndiName="jms.SampleQueue",jndiConnectionFactory="weblogic.jws.jms.QueueConnectionFactory")
+public interface SampleQueue extends JMSControl
+{
+ /**
+ * Submit an xml object (org.apache.xmlbeans) as a text message.
+ * @param document the document.
+ * @param type the message JMS type.
+ */
+ public void submitXml(XmlObject document,@Type String type);
+
+ /**
+ * Submit an xml object (org.apache.xmlbeans) with JMS type "xmlObject".
+ * @param document the document.
+ */
+ @Message(MessageType.Text)
+ @Type("xmlObject")
+ public void submitXml(XmlObject document);
+
+ /**
+ * Submit an already constructed message
+ * @param message the jms-message.
+ */
+ public void submitMessage(Message message);
+}
Propchange: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/SampleQueue.jcx
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/TestOrderQueue.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/TestOrderQueue.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/TestOrderQueue.java (original)
+++ incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/TestOrderQueue.java Tue Jun 14 14:14:42 2005
@@ -1,72 +1,72 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-package org.apache.beehive.controls.system.jms.samples;
-
-import java.util.Date;
-
-import javax.jms.Message;
-import javax.jms.Queue;
-
-import org.apache.beehive.controls.api.bean.Control;
-import org.apache.beehive.controls.system.jms.samples.OrderQueueBean;
-import org.apache.beehive.controls.system.jndi.JndiControlBean;
-
-/**
- * Test the order-queue jms-control.
- * This test case will work with an ejb-container. Just set
- * the system properties jndi.provider and jndi.factory.
- */
-public class TestOrderQueue extends ControlTestCase
-{
- public TestOrderQueue(String name) throws Exception
- {
- super(name);
- }
- public void testQueue() throws Exception
- {
- // Programmatically instantiate order queue.
- OrderQueueBean orders = (OrderQueueBean)instantiateControl("org.apache.beehive.controls.system.jms.samples.OrderQueueBean");
- // Load up jndi info.
- String provider = System.getProperty("jndi.provider");
- if(provider != null)
- {
- orders.setJndiProviderURL(provider);
- }
- String factory = System.getProperty("jndi.factory");
- if(factory != null)
- {
- orders.setJndiContextFactory(factory);
- }
- // Submit an order.
- OrderQueue.Order order = new OrderQueue.Order(5,new String[] { "hair spray"});
- Date now = new Date();
- Message mess = orders.submitOrder(order,now);
- javax.jms.QueueSession sess = (javax.jms.QueueSession)orders.getSession();
- sess.commit();
- // Read the queue using the same session/connection.
- orders.getConnection().start();
- javax.jms.QueueReceiver consumer = sess.createReceiver((Queue)orders.getDestination());
- Message qmess = consumer.receive(5000);
- consumer.close();
- assertNotNull(qmess);
- String by = qmess.getStringProperty("DeliverBy");
- assertNotNull(by);
- assertEquals(by,now);
- }
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.system.jms.samples;
+
+import java.util.Date;
+
+import javax.jms.Message;
+import javax.jms.Queue;
+
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.system.jms.samples.OrderQueueBean;
+import org.apache.beehive.controls.system.jndi.JndiControlBean;
+
+/**
+ * Test the order-queue jms-control.
+ * This test case will work with an ejb-container. Just set
+ * the system properties jndi.provider and jndi.factory.
+ */
+public class TestOrderQueue extends ControlTestCase
+{
+ public TestOrderQueue(String name) throws Exception
+ {
+ super(name);
+ }
+ public void testQueue() throws Exception
+ {
+ // Programmatically instantiate order queue.
+ OrderQueueBean orders = (OrderQueueBean)instantiateControl("org.apache.beehive.controls.system.jms.samples.OrderQueueBean");
+ // Load up jndi info.
+ String provider = System.getProperty("jndi.provider");
+ if(provider != null)
+ {
+ orders.setJndiProviderURL(provider);
+ }
+ String factory = System.getProperty("jndi.factory");
+ if(factory != null)
+ {
+ orders.setJndiContextFactory(factory);
+ }
+ // Submit an order.
+ OrderQueue.Order order = new OrderQueue.Order(5,new String[] { "hair spray"});
+ Date now = new Date();
+ Message mess = orders.submitOrder(order,now);
+ javax.jms.QueueSession sess = (javax.jms.QueueSession)orders.getSession();
+ sess.commit();
+ // Read the queue using the same session/connection.
+ orders.getConnection().start();
+ javax.jms.QueueReceiver consumer = sess.createReceiver((Queue)orders.getDestination());
+ Message qmess = consumer.receive(5000);
+ consumer.close();
+ assertNotNull(qmess);
+ String by = qmess.getStringProperty("DeliverBy");
+ assertNotNull(by);
+ assertEquals(by,now);
+ }
+
+}
Propchange: incubator/beehive/trunk/system-controls/samples/jms/src/org/apache/beehive/controls/system/jms/samples/TestOrderQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/webservice/amazon/README.txt
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/webservice/amazon/README.txt?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/webservice/amazon/README.txt (original)
+++ incubator/beehive/trunk/system-controls/samples/webservice/amazon/README.txt Tue Jun 14 14:14:42 2005
@@ -1,10 +1,10 @@
-Amazon web services are in beta stage. Their WSDL is subject to change.
-
-This sample is built with the 2005-01-19 version of the Commerce WSDL that was
-obtained from:
-
-http://www.amazon.com/gp/aws/sdk/002-3610582-9148860?
-
-The Alex Web Service WSDL was downloaded from:
-
-http://www.amazon.com/gp/browse.html/ref=sc_fe_l_1/002-3610582-9148860?%5Fencoding=UTF8&node=12782661&no=13584171&me=A36L942TSJ2AJA
+Amazon web services are in beta stage. Their WSDL is subject to change.
+
+This sample is built with the 2005-01-19 version of the Commerce WSDL that was
+obtained from:
+
+http://www.amazon.com/gp/aws/sdk/002-3610582-9148860?
+
+The Alex Web Service WSDL was downloaded from:
+
+http://www.amazon.com/gp/browse.html/ref=sc_fe_l_1/002-3610582-9148860?%5Fencoding=UTF8&node=12782661&no=13584171&me=A36L942TSJ2AJA
Propchange: incubator/beehive/trunk/system-controls/samples/webservice/amazon/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/beehive/trunk/system-controls/samples/webservice/amazon/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/webservice/amazon/junit/AmazonCommerceTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/webservice/amazon/junit/AmazonCommerceTest.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/webservice/amazon/junit/AmazonCommerceTest.java (original)
+++ incubator/beehive/trunk/system-controls/samples/webservice/amazon/junit/AmazonCommerceTest.java Tue Jun 14 14:14:42 2005
@@ -1,124 +1,124 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.beehive.controls.api.bean.Control;
-import org.apache.beehive.wsm.databinding.GenericHolder;
-import org.apache.xmlbeans.XmlCursor;
-import test.ControlTestCase;
-import amazonWS.AWSECommerceService;
-
-import com.amazon.webservices.awsAlexa.x20040915.OperationRequestDocument;
-import com.amazon.webservices.awseCommerceService.x20050323.ErrorsDocument.Errors;
-import com.amazon.webservices.awseCommerceService.x20050323.ItemsDocument.Items;
-import com.amazon.webservices.awseCommerceService.x20050323.OperationRequestDocument.OperationRequest;
-import com.amazon.webservices.awseCommerceService.x20050323.ItemSearchDocument;
-import com.amazon.webservices.awseCommerceService.x20050323.ItemSearchResponseDocument;
-import com.amazon.webservices.awseCommerceService.x20050323.ItemSearchDocument.ItemSearch;
-import com.amazon.webservices.awseCommerceService.x20050323.ItemSearchResponseDocument.ItemSearchResponse;
-import com.amazon.webservices.awseCommerceService.x20050323.ItemSearchRequest;
-
-/*******************************************************************************
- *
- *
- * @author Jonathan Colwell
- */
-public class AmazonCommerceTest extends ControlTestCase {
- String subId = "1QZP1NHPQW2XT7SJ9AG2";
-
- String validate = "False";
-
- @Control
- public AWSECommerceService mAmazonECS;
-
- public void testItemSearch() throws Exception {
-
- String subId = "1QZP1NHPQW2XT7SJ9AG2";
- String validate = "False";
-
- ItemSearchRequest isr = ItemSearchRequest.Factory.newInstance();
- isr.setSearchIndex("SportingGoods");
- isr.setManufacturer("Callaway");
-
- GenericHolder<Items[]> itemsHolder = new GenericHolder<Items[]>(
- new Items[0]);
- GenericHolder<OperationRequest> operationRequestHolder = new GenericHolder<OperationRequest>(
- OperationRequest.Factory.newInstance());
-
- mAmazonECS.ItemSearch(subId, "", "", validate, isr, null, itemsHolder,
- operationRequestHolder);
-
- Items[] items = itemsHolder.value;
- // OperationRequest opReq = searchResults.getOperationRequest();
- assertNotNull(items);
- // assertNotNull(opReq);
- assertTrue("Invalid Item length... Make sure your WSDL is up to date!",
- items.length > 0);
- if (items[0].getRequest().isSetErrors()) {
- Errors errs = items[0].getRequest().getErrors();
- Errors.Error[] errArray = errs.getErrorArray();
- for (Errors.Error err : errArray) {
- System.out.println(err.getMessage());
- }
- }
- assertEquals("True", items[0].getRequest().getIsValid());
-
- }
-
- public void testBatchedItemSearch() throws Exception {
-
- ItemSearchRequest shared = ItemSearchRequest.Factory.newInstance();
- ItemSearchRequest item1 = ItemSearchRequest.Factory.newInstance();
- ItemSearchRequest item2 = ItemSearchRequest.Factory.newInstance();
-
- shared.setSearchIndex("Books");
- item1.setAuthor("Larson");
- item2.setTitle("Horton Hearts");
-
- ItemSearchRequest[] requests = new ItemSearchRequest[2];
- requests[0] = item1;
- requests[1] = item2;
-
- GenericHolder<Items[]> itemsHolder = new GenericHolder<Items[]>(
- new Items[0]);
- GenericHolder<OperationRequest> operationRequestHolder = new GenericHolder<OperationRequest>(
- OperationRequest.Factory.newInstance());
-
- mAmazonECS.ItemSearch(subId, "", "", validate, shared, requests,
- itemsHolder, operationRequestHolder);
-
- Items[] items = itemsHolder.value;
- // OperationRequest opReq = searchResults.getOperationRequest();
- assertNotNull(items);
- // assertNotNull(opReq);
- assertTrue("Invalid Item length... Make sure your WSDL is up to date!",
- items.length > 0);
- if (items[0].getRequest().isSetErrors()) {
- Errors errs = items[0].getRequest().getErrors();
- Errors.Error[] errArray = errs.getErrorArray();
- for (Errors.Error err : errArray) {
- System.out.println(err.getMessage());
- }
- }
- assertEquals("True", items[0].getRequest().getIsValid());
-
- }
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.wsm.databinding.GenericHolder;
+import org.apache.xmlbeans.XmlCursor;
+import test.ControlTestCase;
+import amazonWS.AWSECommerceService;
+
+import com.amazon.webservices.awsAlexa.x20040915.OperationRequestDocument;
+import com.amazon.webservices.awseCommerceService.x20050323.ErrorsDocument.Errors;
+import com.amazon.webservices.awseCommerceService.x20050323.ItemsDocument.Items;
+import com.amazon.webservices.awseCommerceService.x20050323.OperationRequestDocument.OperationRequest;
+import com.amazon.webservices.awseCommerceService.x20050323.ItemSearchDocument;
+import com.amazon.webservices.awseCommerceService.x20050323.ItemSearchResponseDocument;
+import com.amazon.webservices.awseCommerceService.x20050323.ItemSearchDocument.ItemSearch;
+import com.amazon.webservices.awseCommerceService.x20050323.ItemSearchResponseDocument.ItemSearchResponse;
+import com.amazon.webservices.awseCommerceService.x20050323.ItemSearchRequest;
+
+/*******************************************************************************
+ *
+ *
+ * @author Jonathan Colwell
+ */
+public class AmazonCommerceTest extends ControlTestCase {
+ String subId = "1QZP1NHPQW2XT7SJ9AG2";
+
+ String validate = "False";
+
+ @Control
+ public AWSECommerceService mAmazonECS;
+
+ public void testItemSearch() throws Exception {
+
+ String subId = "1QZP1NHPQW2XT7SJ9AG2";
+ String validate = "False";
+
+ ItemSearchRequest isr = ItemSearchRequest.Factory.newInstance();
+ isr.setSearchIndex("SportingGoods");
+ isr.setManufacturer("Callaway");
+
+ GenericHolder<Items[]> itemsHolder = new GenericHolder<Items[]>(
+ new Items[0]);
+ GenericHolder<OperationRequest> operationRequestHolder = new GenericHolder<OperationRequest>(
+ OperationRequest.Factory.newInstance());
+
+ mAmazonECS.ItemSearch(subId, "", "", validate, isr, null, itemsHolder,
+ operationRequestHolder);
+
+ Items[] items = itemsHolder.value;
+ // OperationRequest opReq = searchResults.getOperationRequest();
+ assertNotNull(items);
+ // assertNotNull(opReq);
+ assertTrue("Invalid Item length... Make sure your WSDL is up to date!",
+ items.length > 0);
+ if (items[0].getRequest().isSetErrors()) {
+ Errors errs = items[0].getRequest().getErrors();
+ Errors.Error[] errArray = errs.getErrorArray();
+ for (Errors.Error err : errArray) {
+ System.out.println(err.getMessage());
+ }
+ }
+ assertEquals("True", items[0].getRequest().getIsValid());
+
+ }
+
+ public void testBatchedItemSearch() throws Exception {
+
+ ItemSearchRequest shared = ItemSearchRequest.Factory.newInstance();
+ ItemSearchRequest item1 = ItemSearchRequest.Factory.newInstance();
+ ItemSearchRequest item2 = ItemSearchRequest.Factory.newInstance();
+
+ shared.setSearchIndex("Books");
+ item1.setAuthor("Larson");
+ item2.setTitle("Horton Hearts");
+
+ ItemSearchRequest[] requests = new ItemSearchRequest[2];
+ requests[0] = item1;
+ requests[1] = item2;
+
+ GenericHolder<Items[]> itemsHolder = new GenericHolder<Items[]>(
+ new Items[0]);
+ GenericHolder<OperationRequest> operationRequestHolder = new GenericHolder<OperationRequest>(
+ OperationRequest.Factory.newInstance());
+
+ mAmazonECS.ItemSearch(subId, "", "", validate, shared, requests,
+ itemsHolder, operationRequestHolder);
+
+ Items[] items = itemsHolder.value;
+ // OperationRequest opReq = searchResults.getOperationRequest();
+ assertNotNull(items);
+ // assertNotNull(opReq);
+ assertTrue("Invalid Item length... Make sure your WSDL is up to date!",
+ items.length > 0);
+ if (items[0].getRequest().isSetErrors()) {
+ Errors errs = items[0].getRequest().getErrors();
+ Errors.Error[] errArray = errs.getErrorArray();
+ for (Errors.Error err : errArray) {
+ System.out.println(err.getMessage());
+ }
+ }
+ assertEquals("True", items[0].getRequest().getIsValid());
+
+ }
+
+}
Propchange: incubator/beehive/trunk/system-controls/samples/webservice/amazon/junit/AmazonCommerceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/webservice/amazon/junit/log4j.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/webservice/amazon/junit/log4j.properties?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/webservice/amazon/junit/log4j.properties (original)
+++ incubator/beehive/trunk/system-controls/samples/webservice/amazon/junit/log4j.properties Tue Jun 14 14:14:42 2005
@@ -1,22 +1,22 @@
-# Set root category priority to INFO and its only appender to CONSOLE.
-log4j.rootCategory=DEBUG, CONSOLE
-#log4j.rootCategory=INFO, CONSOLE, LOGFILE
-log4j.logger.org.apache.beehive.controls.system.webservice= DEBUG, CONSOLE
-
-# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
-log4j.logger.org.apache.axis= INFO, CONSOLE
-log4j.logger.org.apache.axis.client= debug, CONSOLE
-
-# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=- %c: %m%n
-
-# LOGFILE is set to be a File appender using a PatternLayout.
-log4j.appender.LOGFILE=org.apache.log4j.FileAppender
-log4j.appender.LOGFILE.File=axis.log
-log4j.appender.LOGFILE.Append=true
-log4j.appender.LOGFILE.Threshold=INFO
-log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=DEBUG, CONSOLE
+#log4j.rootCategory=INFO, CONSOLE, LOGFILE
+log4j.logger.org.apache.beehive.controls.system.webservice= DEBUG, CONSOLE
+
+# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
+log4j.logger.org.apache.axis= INFO, CONSOLE
+log4j.logger.org.apache.axis.client= debug, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %c: %m%n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=axis.log
+log4j.appender.LOGFILE.Append=true
+log4j.appender.LOGFILE.Threshold=INFO
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+
Propchange: incubator/beehive/trunk/system-controls/samples/webservice/amazon/junit/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/beehive/trunk/system-controls/samples/webservice/amazon/schemas/AWSAlexa.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/beehive/trunk/system-controls/samples/webservice/amazon/schemas/AWSECommerceService.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/webservice/common/src/test/ControlTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/webservice/common/src/test/ControlTestCase.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/webservice/common/src/test/ControlTestCase.java (original)
+++ incubator/beehive/trunk/system-controls/samples/webservice/common/src/test/ControlTestCase.java Tue Jun 14 14:14:42 2005
@@ -1,80 +1,80 @@
-package test;
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import junit.framework.TestCase;
-
-import org.apache.beehive.controls.api.context.ControlBeanContext;
-import org.apache.beehive.controls.api.context.ControlContainerContext;
-import org.apache.beehive.controls.api.context.ControlThreadContext;
-
-/*******************************************************************************
- *
- *
- * @author Jonathan Colwell
- */
-public abstract class ControlTestCase extends TestCase {
-
- private ControlContainerContext mContext;
-
- public void setUp() throws Exception {
- try {
- mContext = ControlThreadContext.getContext();
- if(mContext == null) {
- mContext = new org.apache.beehive.controls.runtime.bean.
- ControlContainerContext();
- mContext.beginContext();
- }
-
- /*
- * Now that the context is in place, try to initialize the service
- * control client subclass.
- */
- Class cls = getClass();
- Class clientInitializer =
- cls.getClassLoader().loadClass(cls.getName()
- + "ClientInitializer");
-
- Method init =
- clientInitializer.getMethod("initialize",
- ControlBeanContext.class, cls);
- init.invoke(null, mContext, this);
- } catch ( InvocationTargetException ite) {
- Throwable t = ite.getCause();
- System.out.println("Error in method invocation original cause: " + t.getMessage());
- t.printStackTrace();
- ite.printStackTrace();
- throw ite;
- }catch (Exception e) {
- e.printStackTrace();
- throw e;
- }
-
- }
-
- public void tearDown() throws Exception {
- if(mContext != null) {
- mContext.endContext();
- }
- }
-}
+package test;
+
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import junit.framework.TestCase;
+
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.context.ControlContainerContext;
+import org.apache.beehive.controls.api.context.ControlThreadContext;
+
+/*******************************************************************************
+ *
+ *
+ * @author Jonathan Colwell
+ */
+public abstract class ControlTestCase extends TestCase {
+
+ private ControlContainerContext mContext;
+
+ public void setUp() throws Exception {
+ try {
+ mContext = ControlThreadContext.getContext();
+ if(mContext == null) {
+ mContext = new org.apache.beehive.controls.runtime.bean.
+ ControlContainerContext();
+ mContext.beginContext();
+ }
+
+ /*
+ * Now that the context is in place, try to initialize the service
+ * control client subclass.
+ */
+ Class cls = getClass();
+ Class clientInitializer =
+ cls.getClassLoader().loadClass(cls.getName()
+ + "ClientInitializer");
+
+ Method init =
+ clientInitializer.getMethod("initialize",
+ ControlBeanContext.class, cls);
+ init.invoke(null, mContext, this);
+ } catch ( InvocationTargetException ite) {
+ Throwable t = ite.getCause();
+ System.out.println("Error in method invocation original cause: " + t.getMessage());
+ t.printStackTrace();
+ ite.printStackTrace();
+ throw ite;
+ }catch (Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+
+ }
+
+ public void tearDown() throws Exception {
+ if(mContext != null) {
+ mContext.endContext();
+ }
+ }
+}
Propchange: incubator/beehive/trunk/system-controls/samples/webservice/common/src/test/ControlTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/samples/webservice/google/build.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/samples/webservice/google/build.xml?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/samples/webservice/google/build.xml (original)
+++ incubator/beehive/trunk/system-controls/samples/webservice/google/build.xml Tue Jun 14 14:14:42 2005
@@ -1,189 +1,189 @@
-<?xml version="1.0" ?>
-
-<project name="google_sample" default="run.test">
-
- <property environment="env" />
- <property name="beehive.home" value="${env.BEEHIVE_HOME}"/>
- <import file="${beehive.home}/beehive-imports.xml" />
-
- <property name="service.url" value="http://localhost:8080/AddressBookWS/web/Service.jws" />
-
- <property name="build.dir" value="./build" />
- <property name="extgen.dir" value="${build.dir}/extgen" />
- <property name="jcxgen.dir" value="${build.dir}/controlgen" />
- <property name="build.beansrc" value="${build.dir}/beansrc"/>
-
-
- <property name="source.dir" value="./src" />
- <property name="common.source.dir" value="../common/src" />
-
- <property name="junit.source.dir" value="./junit" />
- <property name="test.logs" value="./logs" />
- <property name="servers.dir" value="./servers/local" />
- <!-- test servers -->
- <property name="build.classes" value="${build.dir}/classes" />
- <property name="axisbeangen.dir" value="${build.dir}/axisbeangen" />
- <property name="servicecontrol.jar" value="../../servicecontrol/build/jars/webservice-control.jar" />
-
- <property name="beehive.common.lib.dir" value="${beehive.home}/lib/common" />
-
- <property name="controls.jar" value="${beehive.home}/lib/controls/beehive-controls.jar" />
- <property name="rpc.schema.dir" value="rpc_schemas" />
-
- <property name="testmodel.client.jcxgen.packageName" value="test" />
- <path id="beehive.class.path">
- <fileset dir="${beehive.home}/lib/wsm" includes="*.jar" />
- <pathelement location="${beehive.home}/lib/controls/beehive-controls.jar" />
- <pathelement location="${lib.dir}/junit-3.8.1.jar" />
- <pathelement location="${basedir}/lib/servlet-api-2.4-20040521.jar" />
- <pathelement location="${basedir}/lib/jsp-api-2.0-20040521.jar" />
- <fileset dir="${beehive.common.lib.dir}">
- <include name="**/*.jar" />
- </fileset>
- </path>
-
- <path id="build.classpath">
- <fileset dir="${beehive.home}/lib/wsm">
- <include name="*.jar"/>
- </fileset>
- <pathelement location="${beehive.home}/lib/controls/beehive-webservice-control.jar"/>
- <pathelement location="../lib/commons-cli-1.0.jar"/>
- <!--
- <fileset dir="../../servicecontrol/lib">
- <include name="**/*.jar" />
- </fileset>
- -->
-
- <path refid="beehive.class.path" />
- <pathelement path="${servicecontrol.jar}" />
- </path>
-
- <taskdef name="apt" classname="org.apache.beehive.controls.runtime.generator.AptTask" classpath="${controls.jar}" onerror="report" />
-
- <target name="clean" description="Deletes all generated files">
- <delete dir="${build.dir}" />
- <delete file="velocity.log" />
- <delete dir="${test.logs}" />
- <delete dir="${extgen.dir}" />
- <delete dir="${jcxgen.dir}" />
- <delete dir="${axisbeangen.dir}" />
- </target>
-
- <target name="dirs">
- <mkdir dir="${build.classes}" />
- <mkdir dir="${test.logs}" />
- <mkdir dir="${extgen.dir}" />
- <mkdir dir="${jcxgen.dir}" />
- <mkdir dir="${axisbeangen.dir}" />
- </target>
-
- <target name="build" depends="gen_jcx, build_junit" description="Builds source, and servlets" />
-
-
-
- <target name="gen_jcx" depends="gen_types" unless="noaxisrebuild">
-
-
- <!-- have the wsdls, next to the jcx files -->
-
- <java classname="org.apache.beehive.controls.system.webservice.generator.ExtensionMaker">
- <classpath>
- <path refid="build.classpath" />
- <pathelement location="${build.classes}" />
- </classpath>
- <arg line="-gen_root ${jcxgen.dir}
- -wsdl ${rpc.schema.dir}
- -pkg ${testmodel.client.jcxgen.packageName}
- -wsdl_path_annotation ." />
-
- </java>
-
- <!-- have the wsdls, next to the jcx files -->
- <copy todir="${jcxgen.dir}/${testmodel.client.jcxgen.packageName}">
- <fileset dir="${rpc.schema.dir}">
- <include name="**/*.wsdl" />
- </fileset>
- </copy>
-
- </target>
-
- <target name="do_gen_axis_types" depends="dirs" unless="noaxisrebuild">
- <!-- AXIS Bean build -->
- <taskdef name="axisbeanbuild" classname="org.apache.beehive.wsm.axis.ant.AxisTypeGeneratorTask">
- <classpath>
- <path refid="build.classpath" />
- </classpath>
- </taskdef>
-
- <axisbeanbuild wsdldir="${rpc.schema.dir}" outputdir="${axisbeangen.dir}" />
- <javac srcdir="${axisbeangen.dir}" destdir="${build.classes}" classpathref="build.classpath" debug="true" />
- </target>
-
-
-
- <target name="gen_types">
- <uptodate property="noaxisrebuild" targetfile="${axisbeangen.dir}">
- <srcfiles dir="${rpc.schema.dir}" includes="*.wsdl" />
- </uptodate>
-
- <antcall target="do_gen_axis_types">
- </antcall>
- </target>
-
-
- <target name="build_jcx" depends="gen_jcx">
- <apt srcdir="${jcxgen.dir}" destdir="${build.classes}" gendir="${extgen.dir}" classpathref="build.classpath" compileByExtension="true" srcExtensions="*.jcx,*.java" debug="true" />
-
- <!-- copy wsdls to the classes -->
- <copy todir="${build.classes}">
- <fileset dir="${jcxgen.dir}">
- <include name="**/*.wsdl" />
- <include name="**/*.properties" />
- </fileset>
- </copy>
- </target>
-
-
-
- <target name="build_junit" depends="build_jcx">
-
- <apt srcdir="${common.source.dir}" destdir="${build.classes}" gendir="${build.beansrc}" debug="on" compileByExtension="true" srcExtensions="*.jcx,*.java">
- <classpath>
- <pathelement location="${build.classes}" />
- <path refid="build.classpath" />
- </classpath>
- </apt>
-
- <apt srcdir="${junit.source.dir}" destdir="${build.classes}" gendir="${build.beansrc}" debug="on" compileByExtension="true" srcExtensions="*.jcx,*.java">
- <classpath>
- <pathelement location="${build.classes}" />
- <path refid="build.classpath" />
- </classpath>
- </apt>
-
- <copy todir="${build.classes}">
- <fileset dir="${junit.source.dir}">
- <include name="**/*.key" />
- <!-- get google key -->
- <include name="**/*.properties" />
- </fileset>
- </copy>
-
- </target>
- <target name="run.test" depends="build">
- <echo message="** junit logfiles written to ${test.logs} **" />
- <junit failureproperty="testfailed" printsummary="on" tempdir="${build.dir}" fork="yes">
- <classpath>
- <pathelement location="${build.classes}" />
- <path refid="build.classpath" />
- </classpath>
- <formatter type="plain" />
- <batchtest filtertrace="off" todir="${test.logs}">
- <fileset dir="${junit.source.dir}">
- <include name="**/*Test.java" />
- </fileset>
- </batchtest>
- </junit>
- <fail if="testfailed" message="One or more tests failed." />
- </target>
-</project>
+<?xml version="1.0" ?>
+
+<project name="google_sample" default="run.test">
+
+ <property environment="env" />
+ <property name="beehive.home" value="${env.BEEHIVE_HOME}"/>
+ <import file="${beehive.home}/beehive-imports.xml" />
+
+ <property name="service.url" value="http://localhost:8080/AddressBookWS/web/Service.jws" />
+
+ <property name="build.dir" value="./build" />
+ <property name="extgen.dir" value="${build.dir}/extgen" />
+ <property name="jcxgen.dir" value="${build.dir}/controlgen" />
+ <property name="build.beansrc" value="${build.dir}/beansrc"/>
+
+
+ <property name="source.dir" value="./src" />
+ <property name="common.source.dir" value="../common/src" />
+
+ <property name="junit.source.dir" value="./junit" />
+ <property name="test.logs" value="./logs" />
+ <property name="servers.dir" value="./servers/local" />
+ <!-- test servers -->
+ <property name="build.classes" value="${build.dir}/classes" />
+ <property name="axisbeangen.dir" value="${build.dir}/axisbeangen" />
+ <property name="servicecontrol.jar" value="../../servicecontrol/build/jars/webservice-control.jar" />
+
+ <property name="beehive.common.lib.dir" value="${beehive.home}/lib/common" />
+
+ <property name="controls.jar" value="${beehive.home}/lib/controls/beehive-controls.jar" />
+ <property name="rpc.schema.dir" value="rpc_schemas" />
+
+ <property name="testmodel.client.jcxgen.packageName" value="test" />
+ <path id="beehive.class.path">
+ <fileset dir="${beehive.home}/lib/wsm" includes="*.jar" />
+ <pathelement location="${beehive.home}/lib/controls/beehive-controls.jar" />
+ <pathelement location="${lib.dir}/junit-3.8.1.jar" />
+ <pathelement location="${basedir}/lib/servlet-api-2.4-20040521.jar" />
+ <pathelement location="${basedir}/lib/jsp-api-2.0-20040521.jar" />
+ <fileset dir="${beehive.common.lib.dir}">
+ <include name="**/*.jar" />
+ </fileset>
+ </path>
+
+ <path id="build.classpath">
+ <fileset dir="${beehive.home}/lib/wsm">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement location="${beehive.home}/lib/controls/beehive-webservice-control.jar"/>
+ <pathelement location="../lib/commons-cli-1.0.jar"/>
+ <!--
+ <fileset dir="../../servicecontrol/lib">
+ <include name="**/*.jar" />
+ </fileset>
+ -->
+
+ <path refid="beehive.class.path" />
+ <pathelement path="${servicecontrol.jar}" />
+ </path>
+
+ <taskdef name="apt" classname="org.apache.beehive.controls.runtime.generator.AptTask" classpath="${controls.jar}" onerror="report" />
+
+ <target name="clean" description="Deletes all generated files">
+ <delete dir="${build.dir}" />
+ <delete file="velocity.log" />
+ <delete dir="${test.logs}" />
+ <delete dir="${extgen.dir}" />
+ <delete dir="${jcxgen.dir}" />
+ <delete dir="${axisbeangen.dir}" />
+ </target>
+
+ <target name="dirs">
+ <mkdir dir="${build.classes}" />
+ <mkdir dir="${test.logs}" />
+ <mkdir dir="${extgen.dir}" />
+ <mkdir dir="${jcxgen.dir}" />
+ <mkdir dir="${axisbeangen.dir}" />
+ </target>
+
+ <target name="build" depends="gen_jcx, build_junit" description="Builds source, and servlets" />
+
+
+
+ <target name="gen_jcx" depends="gen_types" unless="noaxisrebuild">
+
+
+ <!-- have the wsdls, next to the jcx files -->
+
+ <java classname="org.apache.beehive.controls.system.webservice.generator.ExtensionMaker">
+ <classpath>
+ <path refid="build.classpath" />
+ <pathelement location="${build.classes}" />
+ </classpath>
+ <arg line="-gen_root ${jcxgen.dir}
+ -wsdl ${rpc.schema.dir}
+ -pkg ${testmodel.client.jcxgen.packageName}
+ -wsdl_path_annotation ." />
+
+ </java>
+
+ <!-- have the wsdls, next to the jcx files -->
+ <copy todir="${jcxgen.dir}/${testmodel.client.jcxgen.packageName}">
+ <fileset dir="${rpc.schema.dir}">
+ <include name="**/*.wsdl" />
+ </fileset>
+ </copy>
+
+ </target>
+
+ <target name="do_gen_axis_types" depends="dirs" unless="noaxisrebuild">
+ <!-- AXIS Bean build -->
+ <taskdef name="axisbeanbuild" classname="org.apache.beehive.wsm.axis.ant.AxisTypeGeneratorTask">
+ <classpath>
+ <path refid="build.classpath" />
+ </classpath>
+ </taskdef>
+
+ <axisbeanbuild wsdldir="${rpc.schema.dir}" outputdir="${axisbeangen.dir}" />
+ <javac srcdir="${axisbeangen.dir}" destdir="${build.classes}" classpathref="build.classpath" debug="true" />
+ </target>
+
+
+
+ <target name="gen_types">
+ <uptodate property="noaxisrebuild" targetfile="${axisbeangen.dir}">
+ <srcfiles dir="${rpc.schema.dir}" includes="*.wsdl" />
+ </uptodate>
+
+ <antcall target="do_gen_axis_types">
+ </antcall>
+ </target>
+
+
+ <target name="build_jcx" depends="gen_jcx">
+ <apt srcdir="${jcxgen.dir}" destdir="${build.classes}" gendir="${extgen.dir}" classpathref="build.classpath" compileByExtension="true" srcExtensions="*.jcx,*.java" debug="true" />
+
+ <!-- copy wsdls to the classes -->
+ <copy todir="${build.classes}">
+ <fileset dir="${jcxgen.dir}">
+ <include name="**/*.wsdl" />
+ <include name="**/*.properties" />
+ </fileset>
+ </copy>
+ </target>
+
+
+
+ <target name="build_junit" depends="build_jcx">
+
+ <apt srcdir="${common.source.dir}" destdir="${build.classes}" gendir="${build.beansrc}" debug="on" compileByExtension="true" srcExtensions="*.jcx,*.java">
+ <classpath>
+ <pathelement location="${build.classes}" />
+ <path refid="build.classpath" />
+ </classpath>
+ </apt>
+
+ <apt srcdir="${junit.source.dir}" destdir="${build.classes}" gendir="${build.beansrc}" debug="on" compileByExtension="true" srcExtensions="*.jcx,*.java">
+ <classpath>
+ <pathelement location="${build.classes}" />
+ <path refid="build.classpath" />
+ </classpath>
+ </apt>
+
+ <copy todir="${build.classes}">
+ <fileset dir="${junit.source.dir}">
+ <include name="**/*.key" />
+ <!-- get google key -->
+ <include name="**/*.properties" />
+ </fileset>
+ </copy>
+
+ </target>
+ <target name="run.test" depends="build">
+ <echo message="** junit logfiles written to ${test.logs} **" />
+ <junit failureproperty="testfailed" printsummary="on" tempdir="${build.dir}" fork="yes">
+ <classpath>
+ <pathelement location="${build.classes}" />
+ <path refid="build.classpath" />
+ </classpath>
+ <formatter type="plain" />
+ <batchtest filtertrace="off" todir="${test.logs}">
+ <fileset dir="${junit.source.dir}">
+ <include name="**/*Test.java" />
+ </fileset>
+ </batchtest>
+ </junit>
+ <fail if="testfailed" message="One or more tests failed." />
+ </target>
+</project>
Propchange: incubator/beehive/trunk/system-controls/samples/webservice/google/build.xml
------------------------------------------------------------------------------
svn:eol-style = native