You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/03/04 01:31:55 UTC
svn commit: r382984 [4/4] - in
/incubator/servicemix/trunk/servicemix-core/src:
main/java/org/apache/servicemix/jbi/container/
main/java/org/apache/servicemix/jbi/framework/
main/java/org/apache/servicemix/jbi/loaders/
main/java/org/apache/servicemix/j...
Copied: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListBindingComponentsTask.java (from r381300, incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListComponentTask.java)
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListBindingComponentsTask.java?p2=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListBindingComponentsTask.java&p1=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListComponentTask.java&r1=381300&r2=382984&rev=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListComponentTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListBindingComponentsTask.java Fri Mar 3 16:31:49 2006
@@ -15,22 +15,16 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.management.ManagementContextMBean;
import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.tools.ant.BuildException;
-import javax.management.ObjectName;
-import java.io.IOException;
-
/**
- * ListComponentTask
+ * ListBindingComponentsTask
*
* @version $Revision:
*/
-public class ListComponentTask extends JbiTask {
- private static final Log log = LogFactory.getLog(DeployedAssembliesTask.class);
+public class ListBindingComponentsTask extends JbiTask {
+
private String sharedLibraryName;
private String serviceAssemblyName;
private String bindingComponentName;
@@ -105,19 +99,9 @@
*
* @throws BuildException
*/
- public void execute() throws BuildException {
- try {
- AdminCommandsServiceMBean acs;
- acs = getAdminCommandsService();
- String result = acs.listComponents(false, true, this.getState(), this.getSharedLibraryName(), this.getServiceAssemblyName());
- System.out.println(result);
- } catch (IOException e) {
- log.error("Caught an exception getting the admin commands service", e);
- throw new BuildException("exception " + e);
- } catch (Exception e) {
- log.error("Error listing component", e);
- throw new BuildException("exception " + e);
- }
-
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ String result = acs.listComponents(true, false, true, getState(), getSharedLibraryName(), getServiceAssemblyName());
+ System.out.println(result);
}
+
}
Added: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListServiceAssembliesTask.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListServiceAssembliesTask.java?rev=382984&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListServiceAssembliesTask.java (added)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListServiceAssembliesTask.java Fri Mar 3 16:31:49 2006
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005-2006 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.
+ */
+package org.apache.servicemix.jbi.management.task;
+
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * List deployed Service Assemblies
+ *
+ * @version $Revision: 379004 $
+ */
+public class ListServiceAssembliesTask extends JbiTask {
+
+ private String state;
+ private String componentName;
+ private String serviceAssemblyName;
+
+ /**
+ *
+ * @return the state
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ *
+ * @param state Sets the state
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ /**
+ *
+ * @return the component name
+ */
+ public String getComponentName() {
+ return componentName;
+ }
+
+ /**
+ *
+ * @param componentName Sets the component name
+ */
+ public void setComponentName(String componentName) {
+ this.componentName = componentName;
+ }
+
+ /**
+ *
+ * @return service assembly name
+ */
+ public String getServiceAssemblyName() {
+ return serviceAssemblyName;
+ }
+
+ /**
+ *
+ * @param serviceAssemblynname Sets the service assembly name
+ */
+ public void setServiceAssemblyName(String serviceAssemblynname) {
+ this.serviceAssemblyName = serviceAssemblynname;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ String result = acs.listServiceAssemblies(getState(), getComponentName(), getServiceAssemblyName());
+ System.out.println(result);
+ }
+
+}
\ No newline at end of file
Copied: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListServiceEnginesTask.java (from r381300, incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListEnginesTask.java)
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListServiceEnginesTask.java?p2=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListServiceEnginesTask.java&p1=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListEnginesTask.java&r1=381300&r2=382984&rev=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListEnginesTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListServiceEnginesTask.java Fri Mar 3 16:31:49 2006
@@ -15,22 +15,16 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.management.ManagementContextMBean;
import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.tools.ant.BuildException;
-import javax.management.ObjectName;
-import java.io.IOException;
-
/**
- * ListEnginesTask
+ * ListServiceEnginesTask
*
* @version $Revision:
*/
-public class ListEnginesTask extends JbiTask {
- private static final Log log = LogFactory.getLog(ListEnginesTask.class);
+public class ListServiceEnginesTask extends JbiTask {
+
private String state;
private String serviceAssemblyName;
private String sharedLibraryName;
@@ -89,20 +83,9 @@
*
* @throws BuildException
*/
- public void execute() throws BuildException {
- try {
- AdminCommandsServiceMBean acs = getAdminCommandsService();
- String result = acs.listComponents(true, false, this.getState(), this.getSharedLibraryName(), this.getServiceAssemblyName());
- System.out.println(result);
- } catch (IOException e) {
- log.error("Caught an exception getting deployed assemblies", e);
- throw new BuildException(e);
-
- } catch (Exception e) {
- log.error("Caught an exception getting deployed assemblies", e);
- throw new BuildException("exception " + e);
- }
-
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ String result = acs.listComponents(false, true, true, getState(), getSharedLibraryName(), getServiceAssemblyName());
+ System.out.println(result);
}
}
Copied: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListSharedLibrariesTask.java (from r381300, incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListLibrariesTask.java)
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListSharedLibrariesTask.java?p2=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListSharedLibrariesTask.java&p1=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListLibrariesTask.java&r1=381300&r2=382984&rev=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListLibrariesTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListSharedLibrariesTask.java Fri Mar 3 16:31:49 2006
@@ -15,24 +15,16 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.tools.ant.BuildException;
-import org.apache.servicemix.jbi.management.ManagementContextMBean;
-import org.apache.servicemix.jbi.management.task.JbiTask;
-import org.apache.servicemix.jbi.management.task.DeployedAssembliesTask;
import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
-
-import javax.management.ObjectName;
-import java.io.IOException;
+import org.apache.tools.ant.BuildException;
/**
- * ListLibrariesTask
+ * ListSharedLibrariesTask
*
* @version $Revision:
*/
-public class ListLibrariesTask extends JbiTask {
- private static final Log log = LogFactory.getLog(DeployedAssembliesTask.class);
+public class ListSharedLibrariesTask extends JbiTask {
+
private String componentName;
private String sharedLibraryName;
@@ -73,18 +65,9 @@
*
* @throws BuildException
*/
- public void execute() throws BuildException {
- try {
- AdminCommandsServiceMBean acs;
- acs = getAdminCommandsService();
- String result = acs.listSharedLibraries(this.getComponentName(), this.getSharedLibraryName());
- System.out.println(result);
- } catch (IOException e) {
- log.error("Caught an exception getting admin commands service", e);
- throw new BuildException(e);
- } catch (Exception e) {
- log.error("Error listing shared libraries", e);
- throw new BuildException(e);
- }
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ String result = acs.listSharedLibraries(getComponentName(), getSharedLibraryName());
+ System.out.println(result);
}
+
}
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownComponentTask.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownComponentTask.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownComponentTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownComponentTask.java Fri Mar 3 16:31:49 2006
@@ -15,20 +15,16 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.management.ManagementContextMBean;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.tools.ant.BuildException;
-import java.io.IOException;
-
/**
* Shutdown a Component
*
* @version $Revision$
*/
public class ShutDownComponentTask extends JbiTask {
- private static final Log log = LogFactory.getLog(ShutDownComponentTask.class);
+
private String name;
/**
@@ -50,21 +46,11 @@
*
* @throws BuildException
*/
- public void execute() throws BuildException {
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
if (name == null) {
throw new BuildException("null componentName");
}
- try {
- ManagementContextMBean is = getManagementContext();
- is.shutDownComponent(name);
- }
- catch (IOException e) {
- log.error("Caught an exception shutting down component", e);
- throw new BuildException(e);
- }
- catch (Exception e) {
- log.error("Caught an exception shutting down component", e);
- throw new BuildException(e);
- }
+ acs.shutdownComponent(name);
}
+
}
Copied: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownServiceAssemblyTask.java (from r381300, incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownAssemblyTask.java)
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownServiceAssemblyTask.java?p2=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownServiceAssemblyTask.java&p1=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownAssemblyTask.java&r1=381300&r2=382984&rev=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownAssemblyTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ShutDownServiceAssemblyTask.java Fri Mar 3 16:31:49 2006
@@ -15,21 +15,16 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.tools.ant.BuildException;
-import javax.jbi.management.DeploymentServiceMBean;
-
-import java.io.IOException;
-
/**
* Shut down a Service Assembly
*
* @version $Revision$
*/
-public class ShutDownAssemblyTask extends JbiTask {
- private static final Log log = LogFactory.getLog(ShutDownAssemblyTask.class);
+public class ShutDownServiceAssemblyTask extends JbiTask {
+
private String name;
/**
@@ -51,21 +46,11 @@
*
* @throws BuildException
*/
- public void execute() throws BuildException {
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
if (name == null) {
- throw new BuildException("null assemblyName");
- }
- try {
- DeploymentServiceMBean is = getDeploymentService();
- is.shutDown(getName());
- }
- catch (IOException e) {
- log.error("Caught an exception shutting down assembly", e);
- throw new BuildException(e);
- }
- catch (Exception e) {
- log.error("Caught an exception shutting down assembly", e);
- throw new BuildException(e);
+ throw new BuildException("null service assembly name");
}
+ acs.shutdownServiceAssembly(name);
}
+
}
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartComponentTask.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartComponentTask.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartComponentTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartComponentTask.java Fri Mar 3 16:31:49 2006
@@ -15,20 +15,16 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.management.ManagementContextMBean;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.tools.ant.BuildException;
-import java.io.IOException;
-
/**
* Start a Component
*
* @version $Revision$
*/
public class StartComponentTask extends JbiTask {
- private static final Log log = LogFactory.getLog(StartComponentTask.class);
+
private String name;
/**
@@ -50,21 +46,11 @@
*
* @throws BuildException
*/
- public void execute() throws BuildException {
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
if (name == null) {
- throw new BuildException("null compoenntName");
- }
- try {
- ManagementContextMBean is = getManagementContext();
- is.startComponent(name);
- }
- catch (IOException e) {
- log.error("Caught an exception starting component", e);
- throw new BuildException(e);
- }
- catch (Exception e) {
- log.error("Caught an exception starting component", e);
- throw new BuildException(e);
+ throw new BuildException("null componentName");
}
+ acs.startComponent(name);
}
+
}
Copied: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartServiceAssemblyTask.java (from r381300, incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartAssemblyTask.java)
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartServiceAssemblyTask.java?p2=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartServiceAssemblyTask.java&p1=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartAssemblyTask.java&r1=381300&r2=382984&rev=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartAssemblyTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StartServiceAssemblyTask.java Fri Mar 3 16:31:49 2006
@@ -15,21 +15,16 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.tools.ant.BuildException;
-import javax.jbi.management.DeploymentServiceMBean;
-
-import java.io.IOException;
-
/**
* Start a Service Assembly
*
* @version $Revision$
*/
-public class StartAssemblyTask extends JbiTask {
- private static final Log log = LogFactory.getLog(StartAssemblyTask.class);
+public class StartServiceAssemblyTask extends JbiTask {
+
private String name; //assembly name to get descriptor for
/**
@@ -51,21 +46,11 @@
*
* @throws BuildException
*/
- public void execute() throws BuildException {
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
if (name == null) {
- throw new BuildException("null assemblyName");
- }
- try {
- DeploymentServiceMBean is = getDeploymentService();
- is.start(getName());
- }
- catch (IOException e) {
- log.error("Caught an exception starting assembly", e);
- throw new BuildException(e);
- }
- catch (Exception e) {
- log.error("Caught an exception starting assembly", e);
- throw new BuildException(e);
+ throw new BuildException("null service assembly name");
}
+ acs.startServiceAssembly(name);
}
+
}
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopComponentTask.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopComponentTask.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopComponentTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopComponentTask.java Fri Mar 3 16:31:49 2006
@@ -15,20 +15,16 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.management.ManagementContextMBean;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.tools.ant.BuildException;
-import java.io.IOException;
-
/**
* Stop a Component
*
* @version $Revision$
*/
public class StopComponentTask extends JbiTask {
- private static final Log log = LogFactory.getLog(StopComponentTask.class);
+
private String name;
/**
@@ -50,21 +46,11 @@
*
* @throws BuildException
*/
- public void execute() throws BuildException {
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
if (name == null) {
- throw new BuildException("null compoenntName");
- }
- try {
- ManagementContextMBean is = getManagementContext();
- is.stopComponent(name);
- }
- catch (IOException e) {
- log.error("Caught an exception stopping component", e);
- throw new BuildException(e);
- }
- catch (Exception e) {
- log.error("Caught an exception stopping component", e);
- throw new BuildException(e);
+ throw new BuildException("null componentName");
}
+ acs.stopComponent(name);
}
+
}
Copied: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopServiceAssemblyTask.java (from r381300, incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopAssemblyTask.java)
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopServiceAssemblyTask.java?p2=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopServiceAssemblyTask.java&p1=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopAssemblyTask.java&r1=381300&r2=382984&rev=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopAssemblyTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/StopServiceAssemblyTask.java Fri Mar 3 16:31:49 2006
@@ -15,21 +15,16 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.tools.ant.BuildException;
-import javax.jbi.management.DeploymentServiceMBean;
-
-import java.io.IOException;
-
/**
* Stop a Service Assembly
*
* @version $Revision$
*/
-public class StopAssemblyTask extends JbiTask {
- private static final Log log = LogFactory.getLog(StopAssemblyTask.class);
+public class StopServiceAssemblyTask extends JbiTask {
+
private String name; //assembly name to stop.
/**
@@ -51,21 +46,11 @@
*
* @throws BuildException
*/
- public void execute() throws BuildException {
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
if (name == null) {
- throw new BuildException("null assemblyName");
- }
- try {
- DeploymentServiceMBean is = getDeploymentService();
- is.stop(getName());
- }
- catch (IOException e) {
- log.error("Caught an exception stopping assembly", e);
- throw new BuildException(e);
- }
- catch (Exception e) {
- log.error("Caught an exception stopping assembly", e);
- throw new BuildException(e);
+ throw new BuildException("null componentName");
}
+ acs.stopServiceAssembly(name);
}
+
}
Copied: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UndeployServiceAssemblyTask.java (from r381300, incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallAssemblyTask.java)
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UndeployServiceAssemblyTask.java?p2=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UndeployServiceAssemblyTask.java&p1=incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallAssemblyTask.java&r1=381300&r2=382984&rev=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallAssemblyTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UndeployServiceAssemblyTask.java Fri Mar 3 16:31:49 2006
@@ -15,21 +15,16 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.tools.ant.BuildException;
-import javax.jbi.management.DeploymentServiceMBean;
-
-import java.io.IOException;
-
/**
* Uninstall an Assembly
*
* @version $Revision$
*/
-public class UninstallAssemblyTask extends JbiTask {
- private static final Log log = LogFactory.getLog(UninstallComponentTask.class);
+public class UndeployServiceAssemblyTask extends JbiTask {
+
private String name; //assembly name to uninstall
/**
@@ -51,21 +46,11 @@
*
* @throws BuildException
*/
- public void execute() throws BuildException {
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
if (name == null) {
- throw new BuildException("null assemblyName");
- }
- try {
- DeploymentServiceMBean is = getDeploymentService();
- is.undeploy(name);
- }
- catch (IOException e) {
- log.error("Caught an exception uninstalling the assembly", e);
- throw new BuildException(e);
- }
- catch (Exception e) {
- log.error("Caught an exception uninstalling the assembly", e);
- throw new BuildException(e);
+ throw new BuildException("null componentName");
}
+ acs.undeployServiceAssembly(name);
}
+
}
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallComponentTask.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallComponentTask.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallComponentTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallComponentTask.java Fri Mar 3 16:31:49 2006
@@ -15,22 +15,17 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.framework.FrameworkInstallationService;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.tools.ant.BuildException;
-import java.io.IOException;
-
/**
* Uninstall a Component
*
* @version $Revision$
*/
public class UninstallComponentTask extends JbiTask {
- private static final Log log = LogFactory.getLog(UninstallComponentTask.class);
+
private String name; //component name to uninstall
- private boolean delete;
/**
* @return Returns the component name.
@@ -47,35 +42,15 @@
}
/**
- * @return Returns the delete.
- */
- public boolean isDelete() {
- return delete;
- }
- /**
- * @param delete The delete to set.
- */
- public void setDelete(boolean delete) {
- this.delete = delete;
- }
-
- /**
* execute the task
*
* @throws BuildException
*/
- public void execute() throws BuildException {
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
if (name == null) {
throw new BuildException("null componentName");
}
- try {
- FrameworkInstallationService is = getInstallationService();
- is.unloadInstaller(name, delete);
- }
- catch (IOException e) {
- log.error("Caught an exception getting the installation service", e);
- throw new BuildException(e);
- }
+ acs.uninstallComponent(name);
}
}
Added: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallSharedLibraryTask.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallSharedLibraryTask.java?rev=382984&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallSharedLibraryTask.java (added)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/UninstallSharedLibraryTask.java Fri Mar 3 16:31:49 2006
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005-2006 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.
+ */
+package org.apache.servicemix.jbi.management.task;
+
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Uninstall a shared library
+ *
+ * @version $Revision: 359151 $
+ */
+public class UninstallSharedLibraryTask extends JbiTask {
+
+ private String name; //shared Library name to uninstall
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (name == null) {
+ throw new BuildException("null componentName");
+ }
+ acs.uninstallSharedLibrary(name);
+ }
+
+}
\ No newline at end of file
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImpl.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImpl.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImpl.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImpl.java Fri Mar 3 16:31:49 2006
@@ -19,6 +19,7 @@
import java.util.List;
import java.util.Map;
+import javax.jbi.JBIException;
import javax.jbi.component.Component;
import javax.jbi.messaging.DeliveryChannel;
import javax.jbi.messaging.ExchangeStatus;
@@ -66,10 +67,6 @@
private BoundedLinkedQueue queue = new BoundedLinkedQueue();
private IdGenerator idGenerator = new IdGenerator();
private MessageExchangeFactory inboundFactory;
- private MessagingStats messagingStats;
- private boolean exchangeThrottling;
- private long throttlingTimeout = 100;
- private int throttlingInterval = 1;
private int intervalCount = 0;
private long lastSendTime = System.currentTimeMillis();
private long lastReceiveTime = System.currentTimeMillis();
@@ -85,7 +82,6 @@
*/
public DeliveryChannelImpl(JBIContainer container, String componentName) {
this.container = container;
- this.messagingStats = new MessagingStats(componentName);
}
/**
@@ -135,7 +131,15 @@
for (int i = 0; i < threads.length; i++) {
((Thread) threads[i]).interrupt();
}
- // TODO: deactivate all endpoints from this component
+ // deactivate all endpoints from this component
+ ServiceEndpoint[] endpoints = (ServiceEndpoint[]) componentConnector.getActiveEndpoints().toArray(new ServiceEndpoint[0]);
+ for (int i = 0; i < endpoints.length; i++) {
+ try {
+ componentConnector.getContext().deactivateEndpoint(endpoints[i]);
+ } catch (JBIException e) {
+ log.error("Error deactivating endpoint", e);
+ }
+ }
// TODO: Cause all accepts to return null
// TODO: Abort all pending exchanges
}
@@ -408,11 +412,11 @@
messageExchange.setPersistent(persistent);
}
- if (exchangeThrottling) {
- if (throttlingInterval > intervalCount) {
+ if (componentConnector.isExchangeThrottling()) {
+ if (componentConnector.getThrottlingInterval() > intervalCount) {
intervalCount = 0;
try {
- Thread.sleep(throttlingTimeout);
+ Thread.sleep(componentConnector.getThrottlingTimeout());
}
catch (InterruptedException e) {
log.warn("throttling failed", e);
@@ -422,6 +426,7 @@
}
// Update stats
+ MessagingStats messagingStats = componentConnector.getMessagingStats();
long currentTime = System.currentTimeMillis();
if (container.isNotifyStatistics()) {
long oldCount = messagingStats.getOutboundExchanges().getCount();
@@ -595,69 +600,6 @@
}
/**
- * Get the MessagingStats
- *
- * @return messaging stats
- */
- public MessagingStats getMessagingStats() {
- return messagingStats;
- }
-
- /**
- * Is MessageExchange sender throttling enabled ?
- *
- * @return true if throttling enabled
- */
- public boolean isExchangeThrottling() {
- return exchangeThrottling;
- }
-
- /**
- * Set message throttling
- *
- * @param value
- */
- public void setExchangeThrottling(boolean value) {
- this.exchangeThrottling = value;
- }
-
- /**
- * Get the throttling timeout
- *
- * @return throttling tomeout (ms)
- */
- public long getThrottlingTimeout() {
- return throttlingTimeout;
- }
-
- /**
- * Set the throttling timout
- *
- * @param value (ms)
- */
- public void setThrottlingTimeout(long value) {
- throttlingTimeout = value;
- }
-
- /**
- * Get the interval for throttling - number of Exchanges set before the throttling timeout is applied
- *
- * @return interval for throttling
- */
- public int getThrottlingInterval() {
- return throttlingInterval;
- }
-
- /**
- * Set the throttling interval number of Exchanges set before the throttling timeout is applied
- *
- * @param value
- */
- public void setThrottlingInterval(int value) {
- throttlingInterval = value;
- }
-
- /**
* Used internally for passing in a MessageExchange
*
* @param me
@@ -667,6 +609,7 @@
checkNotClosed();
// Update stats
+ MessagingStats messagingStats = componentConnector.getMessagingStats();
long currentTime = System.currentTimeMillis();
if (container.isNotifyStatistics()) {
long oldCount = messagingStats.getInboundExchanges().getCount();
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/Broker.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/Broker.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/Broker.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/Broker.java Fri Mar 3 16:31:49 2006
@@ -53,6 +53,7 @@
import org.apache.servicemix.jbi.servicedesc.AbstractServiceEndpoint;
import org.apache.servicemix.jbi.servicedesc.ExternalEndpoint;
import org.apache.servicemix.jbi.servicedesc.InternalEndpoint;
+import org.apache.servicemix.jbi.servicedesc.LinkedEndpoint;
/**
* The Broker handles Nomalised Message Routing within ServiceMix
@@ -513,5 +514,25 @@
public JBIContainer getContainer() {
return container;
}
+
+ public void registerInterfaceConnection(QName fromItf, QName toSvc, String toEp) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void unregisterInterfaceConnection(QName fromItf, QName toSvc, String toEp) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void registerEndpointConnection(QName fromSvc, String fromEp, QName toSvc, String toEp, String link) {
+ LinkedEndpoint ep = new LinkedEndpoint(fromSvc, fromEp, toSvc, toEp, link);
+ // TODO register endpoint
+ }
+
+ public void unregisterEndpointConnection(QName fromSvc, String fromEp, QName toSvc, String toEp) {
+ // TODO Auto-generated method stub
+
+ }
}
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/servicedesc/LinkedEndpoint.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/servicedesc/LinkedEndpoint.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/servicedesc/LinkedEndpoint.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/servicedesc/LinkedEndpoint.java Fri Mar 3 16:31:49 2006
@@ -37,13 +37,12 @@
private final String toEndpoint;
private final String linkType;
- public LinkedEndpoint(ComponentNameSpace componentName,
- QName fromService,
+ public LinkedEndpoint(QName fromService,
String fromEndpoint,
QName toService,
String toEndpoint,
String linkType) {
- super(componentName);
+ super(null);
this.fromService = fromService;
this.fromEndpoint = fromEndpoint;
this.toService = toService;
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/DOMUtil.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/DOMUtil.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/DOMUtil.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/DOMUtil.java Fri Mar 3 16:31:49 2006
@@ -25,6 +25,7 @@
import org.w3c.dom.NodeList;
import javax.xml.namespace.QName;
+import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
@@ -86,6 +87,17 @@
*/
public static String asXML(Node node) throws TransformerException {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ StringWriter buffer = new StringWriter();
+ transformer.transform(new DOMSource(node), new StreamResult(buffer));
+ return buffer.toString();
+ }
+
+ /**
+ * A helper method useful for debugging and logging which will convert the given DOM node into XML text
+ */
+ public static String asIndentedXML(Node node) throws TransformerException {
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
StringWriter buffer = new StringWriter();
transformer.transform(new DOMSource(node), new StreamResult(buffer));
return buffer.toString();
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/FileVersionUtil.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/FileVersionUtil.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/FileVersionUtil.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/FileVersionUtil.java Fri Mar 3 16:31:49 2006
@@ -34,9 +34,8 @@
*
* @param rootDirectory
* @return the version number
- * @throws IOException
*/
- public static int getLatestVersionNumber(File rootDirectory) throws IOException{
+ public static int getLatestVersionNumber(File rootDirectory) {
int result=-1;
if(isVersioned(rootDirectory)){
File[] files=rootDirectory.listFiles();
@@ -57,7 +56,7 @@
* @return the directory
* @throws IOException
*/
- public static File getLatestVersionDirectory(File rootDirectory) throws IOException{
+ public static File getLatestVersionDirectory(File rootDirectory) {
File result=null;
int highestVersion=-1;
if(isVersioned(rootDirectory)){
@@ -133,7 +132,7 @@
}
}
- private static boolean isVersioned(File rootDirectory) throws IOException{
+ private static boolean isVersioned(File rootDirectory) {
boolean result=false;
if(rootDirectory.exists()&&rootDirectory.isDirectory()){
File[] files=rootDirectory.listFiles();
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ClassLoaderTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ClassLoaderTest.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ClassLoaderTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ClassLoaderTest.java Fri Mar 3 16:31:49 2006
@@ -17,8 +17,8 @@
import java.net.URLClassLoader;
-import org.apache.servicemix.jbi.framework.ParentFirstClassLoader;
-import org.apache.servicemix.jbi.framework.SelfFirstClassLoader;
+import org.apache.servicemix.jbi.loaders.ParentFirstClassLoader;
+import org.apache.servicemix.jbi.loaders.SelfFirstClassLoader;
import junit.framework.TestCase;
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ComponentRegistryTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ComponentRegistryTest.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ComponentRegistryTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ComponentRegistryTest.java Fri Mar 3 16:31:49 2006
@@ -33,13 +33,12 @@
}
public void testRegister() throws Exception {
- ComponentRegistry reg = new ComponentRegistry(null);
+ ComponentRegistry reg = new ComponentRegistry(new Registry());
Component component = new SenderComponent();
LocalComponentConnector con = reg.registerComponent(
new ComponentNameSpace("container", "name", "id"),
"description",
component,
- null,
false,
false);
assertNotNull(con);
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/AbstractManagementTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/AbstractManagementTest.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/AbstractManagementTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/AbstractManagementTest.java Fri Mar 3 16:31:49 2006
@@ -70,6 +70,10 @@
}
}
+ protected JBIContainer getContainer() {
+ return container;
+ }
+
protected File createInstallerArchive(String jbi) throws Exception {
InputStream is = getClass().getResourceAsStream(jbi + "-jbi.xml");
File jar = File.createTempFile("jbi", ".zip");
@@ -84,7 +88,22 @@
return jar;
}
+ protected File createDummyArchive() throws Exception {
+ File jar = File.createTempFile("jbi", ".zip");
+ JarOutputStream jos = new JarOutputStream(new FileOutputStream(jar));
+ jos.putNextEntry(new ZipEntry("test.txt"));
+ jos.closeEntry();
+ jos.close();
+ return jar;
+ }
+
protected File createServiceAssemblyArchive(String saName, String suName, String compName) throws Exception {
+ return createServiceAssemblyArchive(saName,
+ new String[] { suName },
+ new String[] { compName });
+ }
+
+ protected File createServiceAssemblyArchive(String saName, String[] suName, String[] compName) throws Exception {
File jar = File.createTempFile("jbi", ".zip");
JarOutputStream jos = new JarOutputStream(new FileOutputStream(jar));
// Write jbi.xml
@@ -101,32 +120,36 @@
xsw.writeCharacters(saName);
xsw.writeEndElement();
xsw.writeEndElement();
- xsw.writeStartElement("service-unit");
- xsw.writeStartElement("identification");
- xsw.writeStartElement("name");
- xsw.writeCharacters(suName);
- xsw.writeEndElement();
- xsw.writeEndElement();
- xsw.writeStartElement("target");
- xsw.writeStartElement("artifacts-zip");
- xsw.writeCharacters(suName + ".zip");
+ for (int i = 0; i < suName.length; i++) {
+ xsw.writeStartElement("service-unit");
+ xsw.writeStartElement("identification");
+ xsw.writeStartElement("name");
+ xsw.writeCharacters(suName[i]);
+ xsw.writeEndElement();
xsw.writeEndElement();
- xsw.writeStartElement("component-name");
- xsw.writeCharacters(compName);
+ xsw.writeStartElement("target");
+ xsw.writeStartElement("artifacts-zip");
+ xsw.writeCharacters(suName[i] + ".zip");
+ xsw.writeEndElement();
+ xsw.writeStartElement("component-name");
+ xsw.writeCharacters(compName[i]);
+ xsw.writeEndElement();
xsw.writeEndElement();
xsw.writeEndElement();
- xsw.writeEndElement();
+ }
xsw.writeEndElement();
xsw.writeEndElement();
xsw.writeEndDocument();
xsw.flush();
jos.closeEntry();
// Put su artifact
- jos.putNextEntry(new ZipEntry(suName + ".zip"));
- JarOutputStream jos2 = new JarOutputStream(jos, new Manifest());
- jos2.finish();
- jos2.flush();
- jos.closeEntry();
+ for (int i = 0; i < suName.length; i++) {
+ jos.putNextEntry(new ZipEntry(suName[i] + ".zip"));
+ JarOutputStream jos2 = new JarOutputStream(jos, new Manifest());
+ jos2.finish();
+ jos2.flush();
+ jos.closeEntry();
+ }
// Close jar
jos.close();
return jar;
Added: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DeploymentMessageTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DeploymentMessageTest.java?rev=382984&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DeploymentMessageTest.java (added)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DeploymentMessageTest.java Fri Mar 3 16:31:49 2006
@@ -0,0 +1,232 @@
+/*
+ * Copyright 2005-2006 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.
+ */
+package org.apache.servicemix.jbi.installation;
+
+import java.io.File;
+
+import javax.xml.transform.TransformerException;
+
+import org.apache.servicemix.jbi.framework.ManagementSupport;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.jbi.util.DOMUtil;
+import org.apache.xml.utils.PrefixResolver;
+import org.apache.xpath.CachedXPathAPI;
+import org.apache.xpath.objects.XObject;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class DeploymentMessageTest extends AbstractManagementTest {
+
+ protected void initContainer() {
+ container.setCreateMBeanServer(false);
+ container.setMonitorInstallationDirectory(false);
+ container.setMonitorDeploymentDirectory(false);
+ }
+
+ public void testDeployNullJarUrl() throws Exception {
+ startContainer(true);
+ try {
+ getDeploymentService().deploy(null);
+ fail("Deploy with null jar url should have failed");
+ } catch (Exception e) {
+ assertTrue(e instanceof Exception);
+ String str = e.getMessage();
+ System.err.println(str);
+ Node node = new SourceTransformer().toDOMNode(new StringSource(str));
+ assertNotNull(node);
+ assertEquals("FAILED", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-result"));
+ assertEquals("ERROR", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:message-type"));
+ assertEquals("deploy", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-id"));
+ }
+ }
+
+ public void testDeployNonExistentJar() throws Exception {
+ startContainer(true);
+ try {
+ getDeploymentService().deploy("hello");
+ fail("Deploy with non existent jar url should have failed");
+ } catch (Exception e) {
+ assertTrue(e instanceof Exception);
+ String str = e.getMessage();
+ System.err.println(str);
+ Node node = new SourceTransformer().toDOMNode(new StringSource(str));
+ assertNotNull(node);
+ assertEquals("FAILED", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-result"));
+ assertEquals("ERROR", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:message-type"));
+ assertEquals("deploy", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-id"));
+ }
+ }
+
+ public void testDeployNoDescriptor() throws Exception {
+ startContainer(true);
+ String jarUrl = createDummyArchive().getAbsolutePath();
+ try {
+ getDeploymentService().deploy(jarUrl);
+ fail("Deploy with non existent descriptor should have failed");
+ } catch (Exception e) {
+ assertTrue(e instanceof Exception);
+ String str = e.getMessage();
+ System.err.println(str);
+ Node node = new SourceTransformer().toDOMNode(new StringSource(str));
+ assertNotNull(node);
+ assertEquals("FAILED", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-result"));
+ assertEquals("ERROR", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:message-type"));
+ assertEquals("deploy", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-id"));
+ }
+ }
+
+ public void testDeployWithNonSADescriptor() throws Exception {
+ startContainer(true);
+ String jarUrl = createInstallerArchive("component1").getAbsolutePath();
+ try {
+ getDeploymentService().deploy(jarUrl);
+ fail("Deploy with non existent descriptor should have failed");
+ } catch (Exception e) {
+ assertTrue(e instanceof Exception);
+ String str = e.getMessage();
+ System.err.println(str);
+ Node node = new SourceTransformer().toDOMNode(new StringSource(str));
+ assertNotNull(node);
+ assertEquals("FAILED", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-result"));
+ assertEquals("ERROR", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:message-type"));
+ assertEquals("deploy", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-id"));
+ }
+ }
+
+ public void testDeployWithSuccess() throws Exception {
+ DummyComponent component = new DummyComponent();
+ String deployResult = DOMUtil.asXML(ManagementSupport.createComponentSuccess("deploy", "component1"));
+ component.setResult(deployResult);
+ System.err.println(deployResult);
+ startContainer(true);
+ getContainer().activateComponent(component, "component1");
+ getContainer().getEnvironmentContext().createComponentRootDirectory("component1");
+ File installSaUrl = createServiceAssemblyArchive("sa", "su", "component1");
+ String result = getDeploymentService().deploy(installSaUrl.getAbsolutePath());
+ System.err.println(result);
+ Node node = new SourceTransformer().toDOMNode(new StringSource(result));
+ assertNotNull(node);
+ // main task
+ assertEquals("SUCCESS", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-result"));
+ assertEquals("deploy", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-id"));
+ // component task
+ assertEquals("SUCCESS", textValueOfXPath(node, "//jbi:component-task-result//jbi:task-result"));
+ assertEquals("deploy", textValueOfXPath(node, "//jbi:component-task-result//jbi:task-id"));
+ }
+
+ public void testDeployWithOneSuccessAndOneError() throws Exception {
+ DummyComponent component1 = new DummyComponent();
+ String deployResult1 = DOMUtil.asXML(ManagementSupport.createComponentFailure("deploy", "component1", "xxx", null));
+ component1.setResult(deployResult1);
+ component1.setException(true);
+ System.err.println(deployResult1);
+ DummyComponent component2 = new DummyComponent();
+ String deployResult2 = DOMUtil.asXML(ManagementSupport.createComponentSuccess("deploy", "component2"));
+ component2.setResult(deployResult2);
+ System.err.println(deployResult2);
+ startContainer(true);
+ getContainer().activateComponent(component1, "component1");
+ getContainer().getEnvironmentContext().createComponentRootDirectory("component1");
+ getContainer().activateComponent(component2, "component2");
+ getContainer().getEnvironmentContext().createComponentRootDirectory("component2");
+ File installSaUrl = createServiceAssemblyArchive("sa", new String[] { "su1", "su2" }, new String[] { "component1", "component2"});
+ String result = getDeploymentService().deploy(installSaUrl.getAbsolutePath());
+ System.err.println(result);
+ Node node = new SourceTransformer().toDOMNode(new StringSource(result));
+ assertNotNull(node);
+ // main task
+ assertEquals("SUCCESS", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-result"));
+ assertEquals("WARNING", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:message-type"));
+ assertEquals("deploy", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-id"));
+ // first component task
+ assertEquals("FAILED", textValueOfXPath(node, "//jbi:component-task-result[1]//jbi:task-result"));
+ assertEquals("deploy", textValueOfXPath(node, "//jbi:component-task-result[1]//jbi:task-id"));
+ // second component task
+ assertEquals("SUCCESS", textValueOfXPath(node, "//jbi:component-task-result[2]//jbi:task-result"));
+ assertEquals("deploy", textValueOfXPath(node, "//jbi:component-task-result[2]//jbi:task-id"));
+ }
+
+ public void testUndeployNullJarUrl() throws Exception {
+ startContainer(true);
+ try {
+ getDeploymentService().undeploy(null);
+ fail("Deploy with null jar url should have failed");
+ } catch (Exception e) {
+ assertTrue(e instanceof Exception);
+ String str = e.getMessage();
+ System.err.println(str);
+ Node node = new SourceTransformer().toDOMNode(new StringSource(str));
+ assertNotNull(node);
+ assertEquals("FAILED", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-result"));
+ assertEquals("ERROR", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:message-type"));
+ assertEquals("undeploy", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-id"));
+ }
+ }
+
+ public void testUndeployNonDeployedSA() throws Exception {
+ startContainer(true);
+ try {
+ getDeploymentService().undeploy("my-sa");
+ fail("Deploy with non deployed sa should have failed");
+ } catch (Exception e) {
+ assertTrue(e instanceof Exception);
+ String str = e.getMessage();
+ System.err.println(str);
+ Node node = new SourceTransformer().toDOMNode(new StringSource(str));
+ assertNotNull(node);
+ assertEquals("FAILED", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-result"));
+ assertEquals("ERROR", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:message-type"));
+ assertEquals("undeploy", textValueOfXPath(node, "//jbi:frmwk-task-result//jbi:task-id"));
+ }
+ }
+
+ protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
+ CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
+ XObject list = cachedXPathAPI.eval(node, xpath, new PrefixResolver() {
+ public String getNamespaceForPrefix(String prefix) {
+ if (prefix.equals("jbi")) {
+ return "http://java.sun.com/xml/ns/jbi/management-message";
+ }
+ return null;
+ }
+ public String getNamespaceForPrefix(String arg0, Node arg1) {
+ return null;
+ }
+ public String getBaseIdentifier() {
+ return null;
+ }
+ public boolean handlesNullPrefixes() {
+ return false;
+ }
+ });
+ Node root = list.nodeset().nextNode();
+ if (root instanceof Element) {
+ Element element = (Element) root;
+ if (element == null) {
+ return "";
+ }
+ String text = DOMUtil.getElementText(element);
+ return text;
+ }
+ else if (root != null) {
+ return root.getNodeValue();
+ } else {
+ return null;
+ }
+ }
+
+}
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DeploymentTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DeploymentTest.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DeploymentTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DeploymentTest.java Fri Mar 3 16:31:49 2006
@@ -122,13 +122,12 @@
manager.deploy(null, null);
managerMock.setMatcher(MockControl.ALWAYS_MATCHER);
managerMock.setReturnValue(null);
- manager.init(null, null);
- managerMock.setMatcher(MockControl.ALWAYS_MATCHER);
replay();
// deploy sa
assertTrue(getDeploymentService().canDeployToComponent("component1"));
File installSaUrl = createServiceAssemblyArchive("sa", "su", "component1");
- getDeploymentService().deploy(installSaUrl.getAbsolutePath());
+ String result = getDeploymentService().deploy(installSaUrl.getAbsolutePath());
+ System.err.println(result);
String[] sas = getDeploymentService().getDeployedServiceAssemblies();
assertNotNull(sas);
assertEquals(1, sas.length);
@@ -144,7 +143,9 @@
// configure mocks
reset();
component.getServiceUnitManager();
- componentMock.setReturnValue(manager, MockControl.ONE_OR_MORE);
+ componentMock.setReturnValue(manager, MockControl.ZERO_OR_MORE);
+ manager.init(null, null);
+ managerMock.setMatcher(MockControl.ALWAYS_MATCHER);
manager.start("su");
replay();
// start sa
@@ -212,8 +213,6 @@
manager.deploy(null, null);
managerMock.setMatcher(MockControl.ALWAYS_MATCHER);
managerMock.setReturnValue(null);
- manager.init(null, null);
- managerMock.setMatcher(MockControl.ALWAYS_MATCHER);
replay();
// deploy sa
assertTrue(getDeploymentService().canDeployToComponent("component1"));
@@ -317,8 +316,6 @@
manager.deploy(null, null);
managerMock.setMatcher(MockControl.ALWAYS_MATCHER);
managerMock.setReturnValue(null);
- manager.init(null, null);
- managerMock.setMatcher(MockControl.ALWAYS_MATCHER);
replay();
// deploy sa
assertTrue(getDeploymentService().canDeployToComponent("component1"));
@@ -338,8 +335,8 @@
// configure mocks
reset();
- component.getServiceUnitManager();
- componentMock.setReturnValue(manager, MockControl.ONE_OR_MORE);
+ manager.init(null, null);
+ managerMock.setMatcher(MockControl.ALWAYS_MATCHER);
manager.start("su");
replay();
// start sa
@@ -352,8 +349,7 @@
reset();
lifecycle.stop();
lifecycle.shutDown();
- component.getServiceUnitManager();
- componentMock.setReturnValue(manager, MockControl.ONE_OR_MORE);
+ manager.stop("su");
manager.shutDown("su");
replay();
// shutdown container
Added: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DummyComponent.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DummyComponent.java?rev=382984&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DummyComponent.java (added)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/installation/DummyComponent.java Fri Mar 3 16:31:49 2006
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2005-2006 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.
+ */
+package org.apache.servicemix.jbi.installation;
+
+import javax.jbi.JBIException;
+import javax.jbi.component.Component;
+import javax.jbi.component.ComponentContext;
+import javax.jbi.component.ComponentLifeCycle;
+import javax.jbi.component.ServiceUnitManager;
+import javax.jbi.management.DeploymentException;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.management.ObjectName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+
+public class DummyComponent implements Component, ComponentLifeCycle, ServiceUnitManager {
+
+ private String result;
+ private boolean exception;
+
+ public DummyComponent() {
+ }
+
+ public ComponentLifeCycle getLifeCycle() {
+ return this;
+ }
+
+ public ServiceUnitManager getServiceUnitManager() {
+ return this;
+ }
+
+ public Document getServiceDescription(ServiceEndpoint endpoint) {
+ return null;
+ }
+
+ public boolean isExchangeWithConsumerOkay(ServiceEndpoint endpoint, MessageExchange exchange) {
+ return false;
+ }
+
+ public boolean isExchangeWithProviderOkay(ServiceEndpoint endpoint, MessageExchange exchange) {
+ return false;
+ }
+
+ public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) {
+ return null;
+ }
+
+ public ObjectName getExtensionMBeanName() {
+ return null;
+ }
+
+ public void init(ComponentContext context) throws JBIException {
+ }
+
+ public void shutDown() throws JBIException {
+ }
+
+ public void start() throws JBIException {
+ }
+
+ public void stop() throws JBIException {
+ }
+
+ public String deploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException {
+ if (exception) {
+ throw new DeploymentException(result);
+ }
+ return result;
+ }
+
+ public void init(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException {
+ }
+
+ public void start(String serviceUnitName) throws DeploymentException {
+ }
+
+ public void stop(String serviceUnitName) throws DeploymentException {
+ }
+
+ public void shutDown(String serviceUnitName) throws DeploymentException {
+ }
+
+ public String undeploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException {
+ if (exception) {
+ throw new DeploymentException(result);
+ }
+ return result;
+ }
+
+ public String getResult() {
+ return result;
+ }
+
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ public boolean isException() {
+ return exception;
+ }
+
+ public void setException(boolean exception) {
+ this.exception = exception;
+ }
+
+}
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskSupport.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskSupport.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskSupport.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskSupport.java Fri Mar 3 16:31:49 2006
@@ -16,6 +16,7 @@
package org.apache.servicemix.jbi.management.task;
import org.apache.servicemix.jbi.container.JBIContainer;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
import org.apache.servicemix.jbi.management.task.JbiTask;
import junit.framework.TestCase;
@@ -42,7 +43,11 @@
// is started in another thread
Thread.sleep(10000);
- remoteConnection = new JbiTask(){};
+ remoteConnection = new JbiTask(){
+ protected void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ }
+
+ };
remoteConnection.init();
}
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskTest.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskTest.java Fri Mar 3 16:31:49 2006
@@ -15,11 +15,9 @@
*/
package org.apache.servicemix.jbi.management.task;
-import org.apache.servicemix.jbi.management.ManagementContextMBean;
-import org.apache.servicemix.jbi.management.task.JbiTask;
-
import javax.jbi.management.DeploymentServiceMBean;
-import javax.jbi.management.InstallationServiceMBean;
+
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
/**
@@ -29,14 +27,17 @@
*/
public class JbiTaskTest extends JbiTaskSupport {
-
private JbiTask jbiTask;
+
/*
* @see TestCase#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
- jbiTask = new JbiTask(){};
+ jbiTask = new JbiTask(){
+ protected void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ }
+ };
jbiTask.init();
}
@@ -47,10 +48,6 @@
jbiTask.close();
super.tearDown();
}
- public void testGetInstallationService() throws Exception {
- InstallationServiceMBean mbean = jbiTask.getInstallationService();
- assertNotNull(mbean);
- }
public void testGetDeploymentService() throws Exception {
DeploymentServiceMBean mbean = jbiTask.getDeploymentService();
@@ -58,8 +55,8 @@
mbean.getDeployedServiceAssemblies();
}
- public void testGetManagementContext() throws Exception {
- ManagementContextMBean mbean = jbiTask.getManagementContext();
+ public void testGetAdminCommandsService() throws Exception {
+ AdminCommandsServiceMBean mbean = jbiTask.getAdminCommandsService();
assertNotNull(mbean);
}
}
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractClusteredTransactionTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractClusteredTransactionTest.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractClusteredTransactionTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractClusteredTransactionTest.java Fri Mar 3 16:31:49 2006
@@ -80,7 +80,7 @@
try {
runClusteredTest(true, true);
fail("sendSync can not be used on clustered flows with external components");
- } catch (IllegalStateException e) {
+ } catch (Exception e) {
// ok
}
}
@@ -93,7 +93,7 @@
try {
runClusteredTest(true, false);
fail("sendSync can not be used on clustered flows with external components");
- } catch (IllegalStateException e) {
+ } catch (Exception e) {
// ok
}
}
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowPersistentTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowPersistentTest.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowPersistentTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowPersistentTest.java Fri Mar 3 16:31:49 2006
@@ -52,7 +52,7 @@
try {
runSimpleTest(true, true);
fail("sendSync can not be used");
- } catch (IllegalStateException e) {
+ } catch (Exception e) {
// sendSync can not be used
}
}
@@ -65,7 +65,7 @@
try {
runSimpleTest(true, false);
fail("sendSync can not be used");
- } catch (IllegalStateException e) {
+ } catch (Exception e) {
// sendSync can not be used
}
}
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowTransactionTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowTransactionTest.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowTransactionTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowTransactionTest.java Fri Mar 3 16:31:49 2006
@@ -51,7 +51,7 @@
try {
runSimpleTest(true, true);
fail("sendSync can not be used");
- } catch (IllegalStateException e) {
+ } catch (Exception e) {
// sendSync can not be used
}
}
@@ -60,7 +60,7 @@
try {
runSimpleTest(true, false);
fail("sendSync can not be used");
- } catch (IllegalStateException e) {
+ } catch (Exception e) {
// sendSync can not be used
}
}
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JmsFlowTransactionTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JmsFlowTransactionTest.java?rev=382984&r1=382983&r2=382984&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JmsFlowTransactionTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JmsFlowTransactionTest.java Fri Mar 3 16:31:49 2006
@@ -31,7 +31,7 @@
try {
runSimpleTest(true, true);
fail("sendSync can not be used");
- } catch (IllegalStateException e) {
+ } catch (Exception e) {
// sendSync can not be used
}
}
@@ -40,7 +40,7 @@
try {
runSimpleTest(true, false);
fail("sendSync can not be used");
- } catch (IllegalStateException e) {
+ } catch (Exception e) {
// sendSync can not be used
}
}