[overlord-commits] Overlord SVN: r121 - in cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src: test/org/jboss/tools/overlord/jbossesb/model/actions and 1 other directory.
overlord-commits at lists.jboss.org
overlord-commits at lists.jboss.org
Fri Jul 4 09:40:31 EDT 2008
Author: objectiser
Date: 2008-07-04 09:40:31 -0400 (Fri, 04 Jul 2008)
New Revision: 121
Added:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/SetMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/SetMessageActionTest.java
Removed:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/GetVariableAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/GetVariableActionTest.java
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/SetStateAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/SetStateActionTest.java
Log:
Changed GetVariableAction to SetMessageAction, as this more accurately reflects the purpose of the action.
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/GetVariableAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/GetVariableAction.java 2008-07-04 13:36:08 UTC (rev 120)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/GetVariableAction.java 2008-07-04 13:40:31 UTC (rev 121)
@@ -1,119 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.tools.overlord.jbossesb.model.actions;
-
-import java.util.logging.Logger;
-
-import org.jboss.tools.overlord.jbossesb.model.*;
-import org.scribble.model.*;
-
-/**
- * The model component for the 'GetVariableAction'.
- *
- * @author gary
- */
-public class GetVariableAction extends AbstractESBAction {
-
- private static final String VARIABLE = "variable";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public GetVariableAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected String[] getMandatoryProperties() {
- return(new String[]{VARIABLE});
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- String variable=getPropertyValue(VARIABLE);
-
- if (variable != null) {
-
- // Check that variable defined on session class
- Class<?> cls=getService().getSessionClass();
-
- if (cls != null) {
- try {
- java.beans.BeanInfo bi=java.beans.Introspector.getBeanInfo(cls);
-
- boolean f_found=false;
-
- java.beans.PropertyDescriptor[] pds=bi.getPropertyDescriptors();
-
- for (int i=0; f_found==false && pds != null &&
- i < pds.length; i++) {
- if (pds[i].getName().equals(variable)) {
- f_found = true;
- }
- }
-
- if (f_found == false) {
- l.error(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.jbossesb.model.actions.Messages"),
- "_NOT_FOUND_VARIABLE",
- new String[]{variable, cls.getName()}), null);
- }
- } catch(Exception e) {
- logger.log(java.util.logging.Level.SEVERE,
- "Failed to check if variable '"+
- variable+"' exists on session class '"+
- cls+"'", e);
- }
- }
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
- }
-
- private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.jbossesb.model.actions");
-}
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/SetMessageAction.java (from rev 120, cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/GetVariableAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/SetMessageAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/SetMessageAction.java 2008-07-04 13:40:31 UTC (rev 121)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.tools.overlord.jbossesb.model.actions;
+
+import org.jboss.tools.overlord.jbossesb.model.*;
+import org.scribble.model.*;
+
+/**
+ * The model component for the 'SetMessageAction'.
+ *
+ * @author gary
+ */
+public class SetMessageAction extends AbstractESBAction {
+
+ public static final String EXPRESSION = "expression";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public SetMessageAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected String[] getMandatoryProperties() {
+ return(new String[]{EXPRESSION});
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/SetStateAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/SetStateAction.java 2008-07-04 13:36:08 UTC (rev 120)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/java/org/jboss/tools/overlord/jbossesb/model/actions/SetStateAction.java 2008-07-04 13:40:31 UTC (rev 121)
@@ -23,7 +23,7 @@
import org.scribble.model.*;
/**
- * The model component for the 'SetVariableAction'.
+ * The model component for the 'SetStateAction'.
*
* @author gary
*/
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/GetVariableActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/GetVariableActionTest.java 2008-07-04 13:36:08 UTC (rev 120)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/GetVariableActionTest.java 2008-07-04 13:40:31 UTC (rev 121)
@@ -1,110 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.tools.overlord.jbossesb.model.actions;
-
-import junit.framework.TestCase;
-
-public class GetVariableActionTest extends TestCase {
-
- public void testValidateNoVariable() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- GetVariableAction action=new GetVariableAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.jbossesb.model.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"variable"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateVariableNotClassProperty() {
- String varName="classX";
- Class<?> cls=java.lang.Object.class;
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
- service.setSessionClass(cls);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("variable", varName);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
- props, null);
-
- GetVariableAction action=new GetVariableAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.jbossesb.model.actions.Messages"),
- "_NOT_FOUND_VARIABLE",
- new String[]{varName, cls.getName()}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateVariableIsClassProperty() {
- String varName="class";
- Class<?> cls=java.lang.Object.class;
-
- TestESBService service=new TestESBService();
- service.setRoot(true);
- service.setSessionClass(cls);
-
- java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
- props.put("variable", varName);
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null,
- props, null);
-
- GetVariableAction action=new GetVariableAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-}
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/SetMessageActionTest.java (from rev 120, cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/GetVariableActionTest.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/SetMessageActionTest.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/SetMessageActionTest.java 2008-07-04 13:40:31 UTC (rev 121)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.tools.overlord.jbossesb.model.actions;
+
+import junit.framework.TestCase;
+
+public class SetMessageActionTest extends TestCase {
+
+ public void testValidateNoExpression() {
+ TestESBService service=new TestESBService();
+ service.setRoot(true);
+
+ java.util.Map<String,String> props=new java.util.Hashtable<String,String>();
+
+ org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
+
+ SetMessageAction action=new SetMessageAction(service, elem);
+
+ service.getActions().add(action);
+
+ TestModelListener l=new TestModelListener();
+
+ l.addExpectedError(org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.jbossesb.model.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{SetMessageAction.EXPRESSION}));
+
+ action.validate(l);
+
+ if (l.isValid() == false) {
+ fail(l.invalidMessage());
+ }
+ }
+}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/SetStateActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/SetStateActionTest.java 2008-07-04 13:36:08 UTC (rev 120)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.jbossesb/src/test/org/jboss/tools/overlord/jbossesb/model/actions/SetStateActionTest.java 2008-07-04 13:40:31 UTC (rev 121)
@@ -40,7 +40,7 @@
java.util.PropertyResourceBundle.getBundle(
"org.jboss.tools.overlord.jbossesb.model.Messages"),
"_NOT_SPECIFIED_PROPERTY",
- new String[]{"variable"}));
+ new String[]{SetStateAction.VARIABLE}));
action.validate(l);
More information about the overlord-commits
mailing list