From: <st...@us...> - 2006-10-05 16:58:55
|
Revision: 3454 http://svn.sourceforge.net/smartfrog/?rev=3454&view=rev Author: steve_l Date: 2006-10-05 09:56:39 -0700 (Thu, 05 Oct 2006) Log Message: ----------- A few days work on the deploy API. WS-N subscribe is working (no interop tests) and WS-N event posting is coming together. Modified Paths: -------------- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/SystemSession.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/WsrfSession.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/components/alpine/deployapi_on_alpine.sf trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/engine/ServerInstance.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/EventSubscriberManager.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/EventSubscription.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/LogEvents.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/PortalHandler.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/SubscriptionService.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/SystemHandler.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/WsrfHandler.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/handlers.sf trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/NotificationSubscription.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/WsrfUtils.java trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/SubscribingTestBase.java trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_31_destroy_events_Test.java trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_32_failure_events_Test.java trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_33_multiple_lifecycle_listeners_Test.java trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_34_running_events_Test.java trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/notification/Api_17_create_system_while_subscribed_Test.java trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/notification/Api_20_multiple_subscriptions_Test.java trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/remote-interop.sf trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/server_and_tests.sf Added Paths: ----------- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/NotifySession.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/AbstractEventSubscription.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/SubscriptionServiceStore.java trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/proxy.sf Removed Paths: ------------- trunk/core/components/deployapi/archives/ trunk/core/components/deployapi/war/ Added: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/NotifySession.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/NotifySession.java (rev 0) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/NotifySession.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -0,0 +1,58 @@ +/** (C) Copyright 2006 Hewlett-Packard Development Company, LP + + This library 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 library 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 library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For more information: www.smartfrog.org + + */ +package org.smartfrog.services.deployapi.alpineclient.model; + +import org.smartfrog.projects.alpine.wsa.AlpineEPR; +import org.smartfrog.projects.alpine.transport.TransmitQueue; +import org.smartfrog.projects.alpine.transport.Transmission; +import org.smartfrog.projects.alpine.om.soap11.MessageDocument; +import nu.xom.Element; + +/** + * This posts a WS-N Notification event to the queue. + * created 05-Oct-2006 16:27:32 + */ + +public class NotifySession extends WsrfSession { + + /** + * construct a new session + * + * @param endpoint + * @param validating + * @param queue + */ + public NotifySession(AlpineEPR endpoint, boolean validating, TransmitQueue queue) { + super(endpoint, validating, queue); + } + + + /** + * End the subscription, extract the EPR. This is validated + * + * @param tx + * @return + */ + public MessageDocument endNotify(Transmission tx) { + tx.blockForResult(getTimeout()); + MessageDocument response = tx.getResponse(); + return response; + } +} Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/SystemSession.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/SystemSession.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/SystemSession.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -101,12 +101,6 @@ return state; } - protected MessageDocument invokeBlocking(String operation,SoapElement request) { - Transmission transmission = queue(operation, request); - return transmission.blockForResult(getTimeout()); - - } - /** * make an run request * Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/WsrfSession.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/WsrfSession.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/alpineclient/model/WsrfSession.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -34,7 +34,6 @@ import org.smartfrog.projects.alpine.core.MessageContext; import org.smartfrog.services.deployapi.system.Constants; import org.smartfrog.services.deployapi.transport.wsrf.WsrfUtils; -import org.smartfrog.services.deployapi.transport.wsrf.WSNConstants; import javax.xml.namespace.QName; import java.util.List; @@ -119,7 +118,6 @@ protected MessageContext createNewMessageContext() { MessageContext ctx = super.createNewMessageContext(); - //ctx.put(ContextConstants.ATTR_SOAP_CONTENT_TYPE, HttpConstants.CONTENT_TYPE_SOAP_XML); return ctx; } @@ -150,8 +148,7 @@ AlpineRuntimeException fault = null; if (payload == null) { fault = new ClientException("Empty body of SOAP message"); - } - if (!XsdUtils.isNamed(payload, expectedType)) { + } else if (!XsdUtils.isNamed(payload, expectedType)) { fault = new ClientException("Wrong response message"); } if (fault != null) { @@ -351,7 +348,7 @@ * @param tx * @return */ - public CallbackSubscription endsSubscribe(Transmission tx) { + public CallbackSubscription endSubscribe(Transmission tx) { tx.blockForResult(getTimeout()); Element payload = extractResponse(tx, QNAME_WSNT_SUBSCRIBE_RESPONSE); return new CallbackSubscription(this,payload); @@ -366,6 +363,11 @@ * @return the transmission */ public CallbackSubscription subscribe(QName topic, String callback, boolean useNotify, String expiryTime) { - return endsSubscribe(beginSubscribe(topic, callback, useNotify, expiryTime)); + return endSubscribe(beginSubscribe(topic, callback, useNotify, expiryTime)); } + + public MessageDocument invokeBlocking(String operation,SoapElement request) { + Transmission transmission = queue(operation, request); + return transmission.blockForResult(getTimeout()); + } } Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/components/alpine/deployapi_on_alpine.sf =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/components/alpine/deployapi_on_alpine.sf 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/components/alpine/deployapi_on_alpine.sf 2006-10-05 16:56:39 UTC (rev 3454) @@ -54,7 +54,7 @@ servlet LAZY alpine; } - SubscriptionEndpoint extends SystemEndpoint { + subscriptionEndpoint extends SubscriptionEndpoint { servlet LAZY alpine; } //subscriptions extends Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/engine/ServerInstance.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/engine/ServerInstance.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/engine/ServerInstance.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -31,6 +31,7 @@ import org.smartfrog.services.deployapi.binding.XomHelper; import org.smartfrog.services.deployapi.components.DeploymentServer; import org.smartfrog.services.deployapi.notifications.EventSubscriberManager; +import org.smartfrog.services.deployapi.notifications.SubscriptionServiceStore; import org.smartfrog.services.deployapi.system.Constants; import org.smartfrog.services.deployapi.system.Utils; import org.smartfrog.services.deployapi.transport.wsrf.PropertyMap; @@ -74,8 +75,12 @@ private AddedFilestore filestore; + //keep all portal subscriptions private EventSubscriberManager subscriptions; + //weak reference store of all subscriptions + private SubscriptionServiceStore subscriptionStore=new SubscriptionServiceStore(); + private File tempdir; private DescriptorHelper descriptorHelper; @@ -88,9 +93,6 @@ private String location = "unknown"; - public static final int WORKERS = 1; - public static final long TIMEOUT = 0; - private static final Log log = LogFactory.getLog(ServerInstance.class); private URL systemsURL; @@ -100,6 +102,8 @@ private int failures = 0; private static final String BUILD_TIMESTAMP = "$Date$"; + + //URL for subscriptions private URL subscriptionURL; /** @@ -367,6 +371,9 @@ */ public ExecutorService createEventExecutorService() { return Executors.newSingleThreadExecutor(); + } + public SubscriptionServiceStore getSubscriptionStore() { + return subscriptionStore; } } Added: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/AbstractEventSubscription.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/AbstractEventSubscription.java (rev 0) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/AbstractEventSubscription.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -0,0 +1,52 @@ +/** (C) Copyright 2006 Hewlett-Packard Development Company, LP + + This library 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 library 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 library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For more information: www.smartfrog.org + + */ +package org.smartfrog.services.deployapi.notifications; + +/** + * created 05-Oct-2006 14:12:35 + */ + +public abstract class AbstractEventSubscription implements EventSubscription { + + private EventSubscriberManager manager; + + /** + * Set the manager + * + * @param manager manager + */ + public synchronized void setManager(EventSubscriberManager manager) { + this.manager=manager; + } + + public EventSubscriberManager getManager() { + return manager; + } + + /** + * Tell the component to do any cleanup, then to unset itself from the manager + */ + public synchronized void unsubscribe() { + if(manager!=null) { + manager.remove(this); + manager=null; + } + } +} Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/EventSubscriberManager.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/EventSubscriberManager.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/EventSubscriberManager.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -26,10 +26,12 @@ import java.util.concurrent.ExecutorService; /** + * something to handle all subscriptions * created 27-Sep-2006 11:34:52 */ -public class EventSubscriberManager implements Iterable<EventSubscription>, EventSubscription { +public class EventSubscriberManager extends AbstractEventSubscription + implements Iterable<EventSubscription>, EventSubscription { private List<EventSubscription> subscriptions=new ArrayList<EventSubscription>(); @@ -45,6 +47,7 @@ } public void add(EventSubscription sub) { subscriptions.add(sub); + sub.setManager(this); } public void remove(EventSubscription sub) { Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/EventSubscription.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/EventSubscription.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/EventSubscription.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -19,7 +19,6 @@ */ package org.smartfrog.services.deployapi.notifications; -import org.smartfrog.services.deployapi.engine.Application; /** * created 27-Sep-2006 10:41:58 @@ -40,4 +39,15 @@ * @return true if the event is still valid; false if it has expired and should be deleted */ boolean probe(); + + /** + * Set the manager + * @param manager manager + */ + void setManager(EventSubscriberManager manager); + + /** + * Tell the component to do any cleanup, then to unset itself from the manager + */ + void unsubscribe(); } Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/LogEvents.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/LogEvents.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/LogEvents.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -27,7 +27,7 @@ * created 27-Sep-2006 14:40:29 */ -public class LogEvents implements EventSubscription { +public class LogEvents extends AbstractEventSubscription implements EventSubscription { private boolean unsubscribed=false; @@ -65,6 +65,7 @@ public void unsubscribe() { unsubscribed=true; + super.unsubscribe(); } public int getEventCount() { Added: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/SubscriptionServiceStore.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/SubscriptionServiceStore.java (rev 0) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/SubscriptionServiceStore.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -0,0 +1,67 @@ +/** (C) Copyright 2006 Hewlett-Packard Development Company, LP + + This library 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 library 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 library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For more information: www.smartfrog.org + + */ +package org.smartfrog.services.deployapi.notifications; + +import org.smartfrog.services.deployapi.transport.wsrf.NotificationSubscription; +import org.smartfrog.services.deployapi.transport.faults.FaultRaiser; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.lang.ref.WeakReference; +import java.util.HashMap; + +/** + * created 05-Oct-2006 12:32:38 + */ + +public class SubscriptionServiceStore { + + private Log log = LogFactory.getLog(SubscriptionServiceStore.class); + + private HashMap<String, WeakReference<NotificationSubscription>> subscriptions = + new HashMap<String, WeakReference<NotificationSubscription>>(); + + + public void add(NotificationSubscription sub) { + subscriptions.put(sub.getId(), new WeakReference<NotificationSubscription>(sub)); + //return a new address + } + + public void remove(String key) { + subscriptions.remove(key); + } + + public void remove(NotificationSubscription sub) { + subscriptions.remove(sub.getId()); + } + + public NotificationSubscription lookup(String key) { + WeakReference<NotificationSubscription> ref = subscriptions.get(key); + if (ref == null) { + FaultRaiser.raiseBadArgumentFault("No such subscription: " + key); + } + NotificationSubscription sub = ref.get(); + if (sub == null) { + log.info("Purging subscription data for " + key); + remove(key); + } + return sub; + } +} Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/PortalHandler.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/PortalHandler.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/PortalHandler.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -34,6 +34,8 @@ import org.smartfrog.projects.alpine.faults.ServerException; import nu.xom.Element; +import javax.xml.namespace.QName; + /** * created 10-Apr-2006 10:54:18 */ @@ -119,7 +121,12 @@ */ protected void registerSubscription(MessageContext messageContext, NotificationSubscription subscription) { + //verify the topic + verifyTopic(Constants.PORTAL_CREATED_EVENT, subscription); + //get the global subscription list EventSubscriberManager subscriptions = getServerInstance().getSubscriptions(); subscriptions.add(subscription); + getServerInstance().getSubscriptionStore().add(subscription); } + } Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/SubscriptionService.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/SubscriptionService.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/SubscriptionService.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -23,6 +23,7 @@ import org.smartfrog.services.deployapi.transport.wsrf.NotificationSubscription; import org.smartfrog.services.deployapi.transport.wsrf.WSRPResourceSource; import org.smartfrog.services.deployapi.transport.faults.FaultRaiser; +import org.smartfrog.services.deployapi.system.Constants; import org.smartfrog.projects.alpine.core.MessageContext; import org.smartfrog.projects.alpine.core.EndpointContext; import org.smartfrog.projects.alpine.om.soap11.MessageDocument; @@ -32,10 +33,8 @@ import org.apache.commons.logging.LogFactory; import nu.xom.Element; -import java.util.HashMap; -import java.lang.ref.WeakReference; - /** + * Endpoint to handle all subscriptions. * created 27-Sep-2006 13:18:32 */ @@ -43,40 +42,11 @@ private Log log= LogFactory.getLog(SubscriptionService.class); - /** - * Use a weak reference hashmap, so that when a subscription is destroyed - * it is automatically purged here. - */ - private HashMap<String, WeakReference<NotificationSubscription>> subscriptions=new HashMap(); - /** - * Add a subscription - * @param sub - */ - public AlpineEPR add(NotificationSubscription sub) { - subscriptions.put(sub.getId(), new WeakReference<NotificationSubscription>(sub)); - //return a new address - return null; + private void remove(NotificationSubscription sub) { + getServerInstance().getSubscriptionStore().remove(sub.getId()); } - public void remove(String key) { - subscriptions.remove(key); - } - - public void remove(NotificationSubscription sub) { - remove(sub.getId()); - } - - public NotificationSubscription lookup(String key) { - WeakReference<NotificationSubscription> ref = subscriptions.get(key); - NotificationSubscription sub = ref.get(); - if(sub==null) { - log.info("Purging subscription data for "+key); - remove(key); - } - return sub; - } - /* Handle <Pause> -> Pause operation could not be performed on the Subscription */ @@ -88,21 +58,31 @@ //exit immediately if processing took place. return; } + MessageDocument request = messageContext.getRequest(); - MessageDocument response = messageContext.createResponse(); - Element payload = messageContext.getRequest().getBody().getFirstChildElement(); + Element payload = request.getBody().getFirstChildElement(); if (payload == null) { throw new ServerException("Empty SOAP message"); } - - NotificationSubscription sub=lookupSubscription(messageContext); - + AlpineEPR to = getTo(request); + String url = to.getAddress(); + String id = NotificationSubscription.extractSubscriptionIDFromQuery(url); + NotificationSubscription sub = getServerInstance().getSubscriptionStore().lookup(id); + if (sub == null) { + FaultRaiser.raiseBadArgumentFault("No subscription at "+url); + } + String requestName = payload.getLocalName(); //TODO: handle WSNT operations - - //this is the pivot point; declare ourselves finished - messageContext.setProcessed(true); -// processor.process(request, response); + if (Constants.WSRF_ELEMENT_DESTROY_REQUEST.equals(requestName)) { + verifyNamespace(getRequest(messageContext), + Constants.WSRF_WSRL_NAMESPACE); + //delete the entry. + sub.unsubscribe(); + remove(sub); + setResponse(messageContext,new Element(Constants.WSRF_ELEMENT_DESTROY_RESPONSE, + Constants.WSRF_WSRL_NAMESPACE)); + } } /** @@ -115,16 +95,13 @@ * */ public WSRPResourceSource retrieveResourceSource(MessageContext message) { - return lookupSubscription(message); - } - - private NotificationSubscription lookupSubscription(MessageContext message) { MessageDocument request = message.getRequest(); AlpineEPR to = getTo(request); - String id = NotificationSubscription.extractSubscriptionIDFromQuery(to.getAddress()); - NotificationSubscription sub = lookup(id); + String url = to.getAddress(); + String id = NotificationSubscription.extractSubscriptionIDFromQuery(url); + NotificationSubscription sub = getServerInstance().getSubscriptionStore().lookup(id); if (sub == null) { - FaultRaiser.raiseBadArgumentFault("No subscription of that address"); + FaultRaiser.raiseBadArgumentFault("No subscription at "+url); } return sub; } Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/SystemHandler.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/SystemHandler.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/SystemHandler.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -174,7 +174,11 @@ */ protected void registerSubscription(MessageContext messageContext, NotificationSubscription subscription) { + //verify the topic + verifyTopic(Constants.SYSTEM_LIFECYCLE_EVENT, subscription); + //register it per-server Application app=lookup(messageContext); app.getSubscribers().add(subscription); + getServerInstance().getSubscriptionStore().add(subscription); } } Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/WsrfHandler.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/WsrfHandler.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/WsrfHandler.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -70,9 +70,8 @@ */ public void process(MessageContext messageContext, EndpointContext endpointContext) { - MessageDocument inMessage = messageContext.getRequest(); - SoapElement request = inMessage.getPayload(); - String requestName = request.getLocalName(); + SoapElement request = getRequest(messageContext); + String requestName = getRequestName(messageContext); QName qName = XsdUtils.makeQName(request); log.info("received " + qName); if (Constants.WSRF_OPERATION_GETRESOURCEPROPERTY.equals(requestName)) { @@ -87,13 +86,27 @@ } if (Constants.WSRF_OPERATION_SUBSCRIBE .equals(requestName)) { - throw FaultRaiser.raiseNotImplementedFault(qName.toString()); + WSNSubscribe(messageContext,endpointContext); } } + protected SoapElement getRequest(MessageContext messageContext) { + return messageContext.getRequest().getPayload(); + } + protected String getRequestName(MessageContext messageContext) { + return messageContext.getRequest().getPayload().getLocalName(); + } /** + * Get the operation of a request + * @param messageContext + * @return qname of the node of the request + */ + protected QName getRequestOperation(MessageContext messageContext) { + return XsdUtils.makeQName(getRequest(messageContext)); + } + /** * Return a resource source for this message. * * @param message @@ -316,4 +329,10 @@ } + protected void verifyTopic(QName expectedTopic, NotificationSubscription subscription) { + QName topic = subscription.getTopic(); + if(!expectedTopic.equals(topic)) { + throw FaultRaiser.raiseBadArgumentFault("Unsupported topic: ["+topic+"] - expected "+expectedTopic); + } + } } Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/handlers.sf =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/handlers.sf 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/handlers.sf 2006-10-05 16:56:39 UTC (rev 3454) @@ -97,7 +97,7 @@ SubscriptionEndpoint extends DeployApiEndpoint { name "subscriptions"; - path "/subscriptions/"; + path "/subscription/"; pivotHandler SubscriptionService; getMessage ## <html> Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/NotificationSubscription.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/NotificationSubscription.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/NotificationSubscription.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -20,6 +20,7 @@ package org.smartfrog.services.deployapi.transport.wsrf; import nu.xom.Element; +import nu.xom.Attribute; import javax.xml.namespace.QName; @@ -28,9 +29,18 @@ import org.smartfrog.services.deployapi.transport.faults.FaultRaiser; import org.smartfrog.services.deployapi.notifications.EventSubscription; import org.smartfrog.services.deployapi.notifications.Event; +import org.smartfrog.services.deployapi.notifications.AbstractEventSubscription; +import org.smartfrog.services.deployapi.alpineclient.model.NotifySession; +import org.smartfrog.services.deployapi.engine.Application; import org.smartfrog.projects.alpine.wsa.AlpineEPR; import org.smartfrog.projects.alpine.om.base.SoapElement; import org.smartfrog.projects.alpine.faults.AlpineRuntimeException; +import org.smartfrog.projects.alpine.xmlutils.XsdUtils; +import org.smartfrog.projects.alpine.transport.TransmitQueue; +import org.smartfrog.projects.alpine.transport.DirectExecutor; +import org.smartfrog.projects.alpine.transport.Transmission; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.List; import java.util.UUID; @@ -52,17 +62,19 @@ </wsnt:InitialTerminationTime>? </wsnt: Subscribe> */ + /** * created 26-Sep-2006 16:35:14. * This represents a WSNT subscription. It contains a static WS resource properties map * as well as parsed data. - * */ -public class NotificationSubscription implements EventSubscription, WSRPResourceSource,WSNConstants { +public class NotificationSubscription extends AbstractEventSubscription + implements EventSubscription, WSRPResourceSource, WSNConstants { + private static Log log= LogFactory.getLog(NotificationSubscription.class); private PropertyMap resources = new PropertyMap(); - private String id= UUID.randomUUID().toString(); + private String id = UUID.randomUUID().toString(); private QName topic; private AlpineEPR callback; private boolean useNotifyMessage; @@ -73,14 +85,19 @@ private String subscriptionURL; private SoapElement subscriptionEndpointer; private AlpineEPR subscriptionEPR; + private NotifySession session; + private int NOTIFY_TIMEOUT; + private AlpineRuntimeException lastError; public NotificationSubscription() { } /** - * @throws org.smartfrog.services.deployapi.transport.faults.BaseException * @param request incoming request * @throws org.smartfrog.services.deployapi.transport.faults.BaseException + * + * @throws org.smartfrog.services.deployapi.transport.faults.BaseException + * * @throws AlpineRuntimeException ifthere is trouble parsing/validating the address */ public NotificationSubscription(Element request) { @@ -90,6 +107,7 @@ /** * check on ID only for equality + * * @param o * @return */ @@ -106,6 +124,7 @@ /** * use ID for hash code + * * @return */ public int hashCode() { @@ -118,14 +137,14 @@ * @return a string representation of the object. */ public String toString() { - return callback==null?"unbound notification":callback.toString(); + return callback == null ? "unbound notification" : callback.toString(); } - private void addWsntResource(String name,Element value) { - if(value!=null) { + private void addWsntResource(String name, Element value) { + if (value != null) { resources.addStaticProperty( - new QName(Constants.WSRF_WSNT_NAMESPACE,name,"wsnt"), - value); + new QName(Constants.WSRF_WSNT_NAMESPACE, name, "wsnt"), + value); } } @@ -134,78 +153,152 @@ new QName(Constants.WSRF_WSNT_NAMESPACE, name, "wsnt"), value); } + /** * Parse the request + * + * @param request * @throws org.smartfrog.services.deployapi.transport.faults.BaseException + * * @throws AlpineRuntimeException ifthere is trouble parsing/validating the address - * @param request */ private void parse(Element request) { resources.addStaticProperty(Constants.PROPERTY_MUWS_RESOURCEID, XomHelper.makeResourceId(getId())); if (!WSNConstants.SUBSCRIBE.equals(request.getLocalName())) { - throw FaultRaiser.raiseBadArgumentFault("wrong element: "+request); + throw FaultRaiser.raiseBadArgumentFault("wrong element: " + request); } - Element endref = XomHelper.getElement(request, "wsnt:"+CONSUMER_REFERENCE, true); - addWsntResource(CONSUMER_REFERENCE,endref); + Element endref = XomHelper.getElement(request, "wsnt:" + CONSUMER_REFERENCE, true); + addWsntResource(CONSUMER_REFERENCE, endref); callback = new AlpineEPR(endref, Constants.WS_ADDRESSING_NAMESPACE); callback.validate(); Element topicExpression = - XomHelper.getElement(request, "wsnt:"+TOPIC_EXPRESSION, true); + XomHelper.getElement(request, "wsnt:" + TOPIC_EXPRESSION, true); String dialect = XomHelper.getAttributeValue(topicExpression, Constants.WSRF_WSNT_NAMESPACE, DIALECT, true); if (!dialect.equals(WSNConstants.SIMPLE_DIALECT)) { throw FaultRaiser.raiseBadArgumentFault("Unsupported Dialect " + dialect); } - addWsntResource(TOPIC_EXPRESSION, topicExpression); - String useNotify = XomHelper.getElementValue(request, "wsnt:"+USE_NOTIFY, false); + //get the qname from the topic. + String qnameExpresion = topicExpression.getValue(); + topic = XsdUtils.resolveQName(topicExpression, qnameExpresion, false); + String useNotify = XomHelper.getElementValue(request, "wsnt:" + USE_NOTIFY, false); if (useNotify != null) { useNotifyMessage = XomHelper.getXsdBoolValue(useNotify); } - addWsntResource(USE_NOTIFY,Boolean.toString(useNotifyMessage)); + addWsntResource(USE_NOTIFY, Boolean.toString(useNotifyMessage)); - subscriptionPolicy = XomHelper.getElement(request, "wsnt:"+SUBSCRIPTION_POLICY, false); - addWsntResource(SUBSCRIPTION_POLICY,subscriptionPolicy); - String termTime = XomHelper.getElementValue(request, "wsnt:"+INITIAL_TERMINATION_TIME, false); + subscriptionPolicy = XomHelper.getElement(request, "wsnt:" + SUBSCRIPTION_POLICY, false); + addWsntResource(SUBSCRIPTION_POLICY, subscriptionPolicy); + String termTime = XomHelper.getElementValue(request, "wsnt:" + INITIAL_TERMINATION_TIME, false); //todo: act on the term time. + + //create the session + session = new NotifySession(callback, true, new TransmitQueue(new DirectExecutor())); } + /* + <wsnt:SubscribeResponse> + <wsnt:SubscriptionReference> + <wsa:Address> Address of Subscription Manager </wsa:Address> + <wsa:ReferenceProperties> + Subscription Identifier + </wsa:ReferenceProperties> + … + </wsnt:SubscriptionReference> + … + </wsnt:SubscribeResponse> + */ + /** * Create a subscription response, which is an EPR in a different namespace + * * @return */ public SoapElement createSubscribeResponse() { - /* - <wsnt:SubscribeResponse> - <wsnt:SubscriptionReference> - <wsa:Address> Address of Subscription Manager </wsa:Address> - <wsa:ReferenceProperties> - Subscription Identifier - </wsa:ReferenceProperties> - … - </wsnt:SubscriptionReference> - … - </wsnt:SubscribeResponse> - */ - SoapElement root = XomHelper.wsntElement(SUBSCRIBE_RESPONSE); - SoapElement address= subscriptionEPR.toXomInNewNamespace(SUBSCRIPTION_REFERENCE, + SoapElement address = subscriptionEPR.toXomInNewNamespace(SUBSCRIPTION_REFERENCE, Constants.WSRF_WSNT_NAMESPACE, "wsnt", Constants.WS_ADDRESSING_NAMESPACE, "wsa"); root.addOrReplaceChild(address); return root; } - /** - * Something happened to this job - * - * @param event the event of interest - */ + /** + * Something happened to this job + * + * @param event the event of interest + */ public void event(Event event) { - //TODO: send the event to the callback + //send the event to the callback + SoapElement request; + Application application = event.application; + SoapElement coreEvent = createMuwsManagementEvent(null, null, application.getId()); + if (isUseNotifyMessage()) { + request = createNotificationMessage(subscriptionEPR, coreEvent); + } else { + request = coreEvent; + } + try { + session.invokeBlocking(null,request); + } catch (AlpineRuntimeException e) { + lastError = e; + //if anything went wrong, log and unsubscribe us. + log.error("Failed to post the event to "+callback,e); + } } + + /** + * Create a new muws event, to which you can append data. + * The event is valid according to muws-p1.xsd. + * + * @param idurl event ID URL; set to null to have one made ip + * @param source any source XML; again, optional. + * @return an event ready to be sent or to have more data appended. + */ + protected SoapElement createMuwsManagementEvent(String idurl, Element source, String resourceID) { + SoapElement event = new SoapElement("muws-p1-xs:ManagementEvent", Constants.MUWS_P1_NAMESPACE); + SoapElement eventID = new SoapElement("muws-p1-xs:EventId", Constants.MUWS_P1_NAMESPACE); + if (idurl == null) { + idurl = "http://example.org/uri/" + UUID.randomUUID().toString(); + } + eventID.appendChild(idurl); + event.appendChild(eventID); + SoapElement sourceComponent = new SoapElement("muws-p1-xs:SourceComponent", Constants.MUWS_P1_NAMESPACE); + SoapElement sourceResource = new SoapElement("muws-p1-xs:ResourceId", Constants.MUWS_P1_NAMESPACE); + sourceResource.appendChild(resourceID); + sourceComponent.appendChild(sourceResource); + if (source != null) { + sourceComponent.appendChild(source); + } + event.appendChild(sourceComponent); + return event; + } + + protected SoapElement createNotificationMessage(AlpineEPR producer, Element message) { + SoapElement notificationMessage = new SoapElement("wsnt:NotificationMessage", Constants.WSRF_WSNT_NAMESPACE); + SoapElement topicElt = new SoapElement("wsnt:Topic", Constants.WSRF_WSNT_NAMESPACE); + topicElt.addAttribute( + new Attribute("wsnt:" + DIALECT, Constants.WSRF_WSNT_NAMESPACE, WSNConstants.SIMPLE_DIALECT)); + topicElt.appendQName(topic); + notificationMessage.appendChild(topicElt); + if (producer != null) { + notificationMessage.appendChild( + producer.toXomInNewNamespace("ProducerReference", Constants.WSRF_WSNT_NAMESPACE, + "wsnt", Constants.WS_ADDRESSING_2004_NAMESPACE, "wsa2004")); + } + if (message != null) { + SoapElement messageElt = new SoapElement("wsnt:Message", Constants.WSRF_WSNT_NAMESPACE); + notificationMessage.appendChild( + messageElt); + messageElt.appendChild(message); + } + return notificationMessage; + } + + public String getId() { return id; } @@ -217,9 +310,18 @@ */ public boolean probe() { //todo: expiry - return true; + return lastError!=null; } + + /** + * Get the last error received on a post. + * @return + */ + public AlpineRuntimeException getLastError() { + return lastError; + } + public QName getTopic() { return topic; } @@ -262,6 +364,7 @@ Constants.WS_ADDRESSING_NAMESPACE, "wsa"); } + /** * Get a property value * @@ -277,11 +380,12 @@ /** * Create a subscription URL and set our URL to it. R + * * @param baseURL * @return the new URL */ public String createSubscriptionURL(URL baseURL) { - setSubscriptionURL(baseURL+ "?" + Constants.SUBSCRIPTION_ID_PARAM + "=" + id); + setSubscriptionURL(baseURL + "?" + Constants.SUBSCRIPTION_ID_PARAM + "=" + id); return subscriptionURL; } @@ -293,13 +397,15 @@ return subscriptionEPR; } - private static final String SEARCH_STRING= Constants.SUBSCRIPTION_ID_PARAM + "="; + private static final String SEARCH_STRING = Constants.SUBSCRIPTION_ID_PARAM + "="; /** * Get the subscription ID from the query + * * @param query * @return the trimmed string containing the subscription - * @throws org.smartfrog.services.deployapi.transport.faults.BaseException if not found + * @throws org.smartfrog.services.deployapi.transport.faults.BaseException + * if not found */ public static String extractSubscriptionIDFromQuery(String query) { if (query == null) { Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/WsrfUtils.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/WsrfUtils.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/WsrfUtils.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -203,7 +203,7 @@ Constants.WS_ADDRESSING_NAMESPACE, "wsa"); subscribe.appendChild(consumer); SoapElement topicElement=WsntElement(WSNConstants.TOPIC_EXPRESSION); - topicElement.addAttribute(new Attribute(WSNConstants.DIALECT, + topicElement.addAttribute(new Attribute("wsnt:" +WSNConstants.DIALECT, Constants.WSRF_WSNT_NAMESPACE, WSNConstants.SIMPLE_DIALECT)); topicElement.appendQName(topic); Modified: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/SubscribingTestBase.java =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/SubscribingTestBase.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/SubscribingTestBase.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -80,6 +80,9 @@ this.subscription = subscription; } + public void waitForSubscription() { + failNotImplemented(); + } /** * unsubscribe, if needed */ Modified: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_31_destroy_events_Test.java =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_31_destroy_events_Test.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_31_destroy_events_Test.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -33,7 +33,7 @@ public void testSubscribe() throws Exception { createSubscribedSystem(getCallbackURL()); - failNotImplemented(); + waitForSubscription(); } } Modified: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_32_failure_events_Test.java =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_32_failure_events_Test.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_32_failure_events_Test.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -33,7 +33,7 @@ public void testSubscribe() throws Exception { createSubscribedSystem(getCallbackURL()); - failNotImplemented(); + waitForSubscription(); } } Modified: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_33_multiple_lifecycle_listeners_Test.java =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_33_multiple_lifecycle_listeners_Test.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_33_multiple_lifecycle_listeners_Test.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -33,7 +33,7 @@ public void testSubscribe() throws Exception { createSubscribedSystem(getCallbackURL()); - failNotImplemented(); + waitForSubscription(); } } Modified: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_34_running_events_Test.java =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_34_running_events_Test.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/lifecycle/Api_34_running_events_Test.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -33,7 +33,7 @@ public void testSubscribe() throws Exception { createSubscribedSystem(getCallbackURL()); - failNotImplemented(); + waitForSubscription(); } } Modified: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/notification/Api_17_create_system_while_subscribed_Test.java =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/notification/Api_17_create_system_while_subscribed_Test.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/notification/Api_17_create_system_while_subscribed_Test.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -35,7 +35,7 @@ public void testCreate_system_while_subscribed() throws Exception { subscribeToSystemCreationEvent(); createSystem(null); - failNotImplemented(); + waitForSubscription(); } } Modified: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/notification/Api_20_multiple_subscriptions_Test.java =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/notification/Api_20_multiple_subscriptions_Test.java 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/notification/Api_20_multiple_subscriptions_Test.java 2006-10-05 16:56:39 UTC (rev 3454) @@ -53,6 +53,6 @@ sub2 = getPortal().subscribeToPortalEvents(getCallbackURL(), true); subscribeToPortal(Constants.PORTAL_CREATED_EVENT); createSystem(null); - failNotImplemented(); + waitForSubscription(); } } Added: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/proxy.sf =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/proxy.sf (rev 0) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/proxy.sf 2006-10-05 16:56:39 UTC (rev 3454) @@ -0,0 +1,34 @@ +/** (C) Copyright 2006 Hewlett-Packard Development Company, LP + +This library 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 library 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 library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +For more information: www.smartfrog.org + +*/ +#include "/org/smartfrog/services/utils/setproperty/components.sf" + +/** + * This is the settings for the server test for steve to do the ports + + */ + Proxy extends SystemProperties { + enabled true; + setOnDeploy enabled; + unsetOnTerminate enabled; + properties [ + ["http.proxyHost","web-proxy"], + ["http.proxyPort","8088"] + ]; + } \ No newline at end of file Modified: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/remote-interop.sf =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/remote-interop.sf 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/remote-interop.sf 2006-10-05 16:56:39 UTC (rev 3454) @@ -27,21 +27,8 @@ #include "/org/smartfrog/services/junit/timeouts/components.sf" #include "/org/smartfrog/services/junit/listeners/xml/components.sf" #include "/org/smartfrog/services/junit/listeners/html/components.sf" +#include "/org/smartfrog/services/deployapi/test/system/alpine/deployapi/proxy.sf" -/** - * This is the settings for the server test for steve to do the ports - - */ - Proxy extends SystemProperties { - enabled true; - setOnDeploy enabled; - unsetOnTerminate enabled; - properties [ - ["http.proxyHost","web-proxy"], - ["http.proxyPort","8088"] - ]; - } - ServerTest extends TimeoutCompound { endpoint TBD; Modified: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/server_and_tests.sf =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/server_and_tests.sf 2006-10-05 16:51:33 UTC (rev 3453) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/server_and_tests.sf 2006-10-05 16:56:39 UTC (rev 3454) @@ -36,22 +36,79 @@ * server after the tests complete */ -#include "/org/smartfrog/services/deployapi/test/system/alpine/deployapi/remote-interop.sf" +#include "/org/smartfrog/services/deployapi/test/system/alpine/deployapi/localhost.sf" #include "/org/smartfrog/services/deployapi/examples/interop/pelvoux_internal.sf" #include "/org/smartfrog/services/assertions/testcomponents.sf" +#include "/org/smartfrog/services/deployapi/test/system/alpine/deployapi/proxy.sf" +TestServer extends ExpectDeploy { -TestServer extends ExpectDeploy { expectTerminate false; action extends PelvouxOnLocalIPAddress { } tests extends Sequence { + } } -sfConfig extends TestServer { +TestListening extends Compound { + proxyEnabled true; + subdir name; + enabled true; + basedir "build/test/interop"; + + proxy extends Proxy { + enabled proxyEnabled; + } + + } + + DeployapiTestRunner extends TestRunner { + + endpoint TBD; + + basedir "/tmp"; + + subdir "deployapi"; + + enabled true; + + + destDir extends Mkdir { + dir subdir; + parentDir LAZY basedir; + } + + console extends ConsoleListener { + }; + + htmlListener extends HtmlTestListener { + outputDirectory LAZY destDir:absolutePath; + } + + listener extends ChainListener { + listeners [ LAZY console, LAZY htmlListener]; + } + + portal extends PortalTestSuite { + endpoint LAZY PARENT:endpoint; + enabled PARENT:enabled; + } + + creation extends CreationTestSuite { + endpoint LAZY PARENT:endpoint; + enabled PARENT:enabled; + } + + } + + +sfConfig extends TestSystem { + +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |