Author: objectiser
Date: 2009-08-24 16:44:21 -0400 (Mon, 24 Aug 2009)
New Revision: 799
Added:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/AbstractESBModelChangeRule.java
Removed:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractStatelessESBAction.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/AbstractStatelessESBModelChangeRule.java
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/dialogs/GenerateDialog.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/eclipse/Activator.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/generator/Generator.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBLanguageModel.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBService.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBAction.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBLanguageModel.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBService.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractESBAction.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractInteractionMessageAction.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/IfAction.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/Messages.properties
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/SwitchAction.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/ConversationInteractionModelChangeRule.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/ConversationModelChangeRule.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/IfModelChangeRule.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/LanguageToConversationModelChangeRule.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/TypeReferenceModelChangeRule.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/plugintest/org/jboss/savara/tools/jbossesb/generator/GeneratorTest.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/DefaultESBLanguageModelTest.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/DefaultESBServiceTest.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/TestESBAction.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/IfActionTest.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/ReceiveMessageActionTest.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/SendMessageActionTest.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/SwitchActionTest.java
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/change/ConversationInteractionModelChangeRuleTest.java
Log:
Change overlord to savara, remove stateful actions and refactor stateless actions to be
the default set of actions. Fixed some of the unit tests - some still to fix.
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/dialogs/GenerateDialog.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/dialogs/GenerateDialog.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/dialogs/GenerateDialog.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -173,27 +173,7 @@
checkStatus();
}
});
-
- Button statelessButton=new Button(group, SWT.CHECK);
- statelessButton.setSelection(true);
-
- gd = new GridData();
- gd.horizontalSpan = 1;
- gd.widthHint = 60;
- statelessButton.setLayoutData(gd);
-
- m_statelessButtons.add(statelessButton);
-
- statelessButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- checkStatus();
- }
- });
-
+
Text projectName=new Text(group, SWT.NONE);
String prjName=m_localModelRefs.get(i).getLocatedRole();
@@ -384,7 +364,6 @@
if (m_roleButtons.get(i).getSelection()) {
generator.generateRole(m_localModelRefs.get(i),
- m_statelessButtons.get(i).getSelection(),
m_projectNames.get(i).getText());
}
}
@@ -427,7 +406,6 @@
private ConversationModel m_conversationModel=null;
private java.util.List<ModelReference> m_localModelRefs=null;
private java.util.List<Button> m_roleButtons=new
java.util.Vector<Button>();
- private java.util.List<Button> m_statelessButtons=new
java.util.Vector<Button>();
private java.util.List<Text> m_projectNames=new java.util.Vector<Text>();
private Combo m_build=null;
private java.util.List<BuildSystem> m_buildSystems=
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/eclipse/Activator.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/eclipse/Activator.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/eclipse/Activator.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -31,7 +31,7 @@
public class Activator extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.soa.overlord.jbossesb";
+ public static final String PLUGIN_ID = "org.jboss.soa.savara.jbossesb";
// The shared instance
private static Activator plugin;
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/generator/Generator.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/generator/Generator.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/generator/Generator.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -121,13 +121,11 @@
* supplied role.
*
* @param localModelRef The local model reference
- * @param stateless Whether the generated role should be stateless
* @param projectName The project name
* @throws Exception Failed to generate role
*/
public void generateRole(ModelReference localModelRef,
- boolean stateless, String projectName)
- throws Exception {
+ String projectName) throws Exception {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Generate local model '"+localModelRef+"' for:
"+
@@ -153,60 +151,59 @@
((ConversationModel)localModel).getConversation() != null) {
ConversationModel lcm=(ConversationModel)localModel;
- // Check if stateless version of model is required
- if (stateless) {
- StatelessTransformer transformer=
- (StatelessTransformer)
- RegistryFactory.getRegistry().getExtension(
- StatelessTransformer.class,null);
+ StatelessTransformer transformer=
+ (StatelessTransformer)
+ RegistryFactory.getRegistry().getExtension(
+ StatelessTransformer.class,null);
- if (transformer != null) {
- Conversation statelessConversation=(Conversation)
- transformer.transform(lcm.getConversation(),
- new ModelReference(JBossESBNotation.NOTATION_CODE));
-
- if (statelessConversation != null) {
+ if (transformer != null) {
+ Conversation statelessConversation=(Conversation)
+ transformer.transform(lcm.getConversation(),
+ new ModelReference(JBossESBNotation.NOTATION_CODE));
- if (logger.isLoggable(Level.FINEST)) {
- try {
- org.scribble.export.Exporter exporter=
- (org.scribble.export.Exporter)
- RegistryFactory.getRegistry().getExtension(
- org.scribble.export.Exporter.class, null);
-
- org.scribble.export.text.TextFormatter formatter=
- new org.scribble.export.text.TextFormatter();
-
- java.io.ByteArrayOutputStream os=
- new java.io.ByteArrayOutputStream();
-
- formatter.setOutputStream(os);
-
- exporter.export(new ModelReference(JBossESBNotation.NOTATION_CODE),
- statelessConversation, formatter);
-
- String str=new String(os.toByteArray());
-
- System.out.println("EXPORTED CDM TO JBESB STATELESS:");
- System.out.println(str);
-
- } catch(Exception e) {
- e.printStackTrace();
- }
- }
+ if (statelessConversation != null) {
+
+ if (logger.isLoggable(Level.FINEST)) {
+ try {
+ org.scribble.export.Exporter exporter=
+ (org.scribble.export.Exporter)
+ RegistryFactory.getRegistry().getExtension(
+ org.scribble.export.Exporter.class, null);
- lcm.setConversation(statelessConversation);
- } else {
- logger.severe("Failed to transform to stateless conversation");
+ org.scribble.export.text.TextFormatter formatter=
+ new org.scribble.export.text.TextFormatter();
+
+ java.io.ByteArrayOutputStream os=
+ new java.io.ByteArrayOutputStream();
+
+ formatter.setOutputStream(os);
+
+ exporter.export(new ModelReference(JBossESBNotation.NOTATION_CODE),
+ statelessConversation, formatter);
+
+ String str=new String(os.toByteArray());
+
+ System.out.println("EXPORTED CDM TO JBESB STATELESS:");
+ System.out.println(str);
+
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
}
+
+ lcm.setConversation(statelessConversation);
+ } else {
+ logger.severe("Failed to transform to stateless conversation");
}
+ } else {
+ logger.severe("Failed to locate stateless transformer");
}
ModelReference targetRef=
new ModelReference(JBossESBNotation.NOTATION_CODE);
DefaultESBLanguageModel target=
- new DefaultESBLanguageModel(targetRef, stateless);
+ new DefaultESBLanguageModel(targetRef);
ModelGenerator generator=(ModelGenerator)
RegistryFactory.getRegistry().getExtension(
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBLanguageModel.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBLanguageModel.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBLanguageModel.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -76,11 +76,9 @@
* This constructor initializes a new ESB configuration.
*
* @param source The model reference for the JBossESB configuration
- * @param stateless Whether the model is stateless
*/
- public DefaultESBLanguageModel(ModelReference source, boolean stateless) {
+ public DefaultESBLanguageModel(ModelReference source) {
m_source = source;
- m_stateless = stateless;
initializeNewConfig();
}
@@ -181,12 +179,6 @@
while (serviter.hasNext()) {
ESBService service=serviter.next();
- // If any service is stateless, then mark the model
- // as stateless
- if (service.isStateless()) {
- m_stateless = true;
- }
-
if (service.isRoot()) {
/*
@@ -252,33 +244,7 @@
getConversations().add(conv);
}
}
-
- //Add session class to list
- String sessionClass=service.getSessionName();
-
- if (sessionClass != null &&
- sessionClasses.contains(sessionClass) == false) {
- sessionClasses.add(sessionClass);
- }
}
-
- // Add dependency on session classes
- for (int i=0; i < sessionClasses.size(); i++) {
- String sessionClass=sessionClasses.get(i);
- int index=sessionClass.lastIndexOf('.');
- String nspace="";
- String local=sessionClass;
-
- if (index != -1) {
- nspace = sessionClass.substring(0, index);
- local = sessionClass.substring(index+1);
-
- dm.recordDependency(getModelReference(),
- new ModelReference(nspace, local,
- null, JAVA_NOTATION),
- DependencyType.Uses);
- }
- }
}
if (logger.isLoggable(java.util.logging.Level.FINEST)) {
@@ -611,14 +577,6 @@
}
/**
- * This method returns whether the model is stateless.
- *
- * @return Whether the model is stateless
- */
- public boolean isStateless() {
- return(m_stateless);
- }
-
/**
* This method returns a custom classloader that uses the project's
* classpath to locate classes referenced by the ESB config file.
@@ -647,7 +605,6 @@
private String m_contents=null;
private java.util.Map<String,ESBService> m_services=new
java.util.Hashtable<String,ESBService>();
private ClassLoader m_classLoader=null;
- private boolean m_stateless=false;
public class InnerModelListener implements ModelListener {
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBService.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBService.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/DefaultESBService.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -42,13 +42,9 @@
public static final String NAME_ATTR = "name";
public static final String DESCRIPTION_ATTR = "description";
public static final String CATEGORY_ATTR = "category";
- public static final String ROOT_PROPERTY = "root";
- public static final String BUSINESS_OBJECT_TYPE_PROPERTY = "session";
public static final String CONVERSATION_TYPE_PROPERTY = "conversationType";
public static final String SERVICE_DESCRIPTION_NAME_PROPERTY =
"serviceDescriptionName";
- public static final String SERVICE_ANNOTATION =
"org.jboss.soa.overlord.jbossesb.actions.Service";
public static final String SERVICE_ELEMENT = "service";
- public static final String RETRIEVE_SESSION_ACTION_CLASS =
"org.jboss.soa.overlord.jbossesb.actions.RetrieveSessionAction";
public static final String ACTION_ELEMENT = "action";
public static final String ACTIONS_ELEMENT = "actions";
@@ -185,25 +181,6 @@
*/
public void validate(ModelListener l) {
- // Check that the service specifies a session
- if (isSessionBased() && getSessionClass() == null) {
-
- // Find first conversation based action to use as
- // focus - if not found then use the service itself
- ESBAction focus=getFirstSessionBasedAction();
- ModelObject src=this;
-
- if (focus instanceof ModelObject) {
- src = (ModelObject)focus;
- }
-
- l.error(new ModelIssue(src, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.savara.tools.jbossesb.model.Messages"),
- "_NOT_SPECIFIED_SESSION_CLASS",
- new String[]{})));
- }
-
for (int i=0; i < m_actions.size(); i++) {
m_actions.get(i).validate(l);
}
@@ -319,60 +296,7 @@
return(false);
}
- protected java.lang.annotation.Annotation getServiceAnnotation(String session) {
- java.lang.annotation.Annotation ret=null;
-
- try {
- ClassLoader cl=
- org.jboss.savara.tools.jbossesb.model.util.ClasspathUtil.getClassLoader(getModel());
-
- Class<?> cls=Class.forName(session, true, cl);
-
- // TODO: This should be replaced by direct lookup
- // of Service annotation - but library not available
- // at the moment
- java.lang.annotation.Annotation[] annotations=
- cls.getAnnotations();
- for (int i=0; ret == null &&
- i < annotations.length; i++) {
- try {
- if (annotations[i].annotationType().getName().equals(
- SERVICE_ANNOTATION)) {
- ret = annotations[i];
- }
- } catch(Throwable ex) {
- logger.log(java.util.logging.Level.SEVERE,
- "ANNOTATION: "+
- annotations[i].annotationType(), ex);
- }
- }
-
- } catch(Throwable e) {
- logger.log(java.util.logging.Level.SEVERE,
- "Failed to get session class '"+session+"'", e);
- }
-
- return(ret);
- }
-
/**
- * This method determines whether the ESB service represents a
- * loop construct.
- *
- * @return Whether the service represents a loop
- */
- public boolean isLoop() {
- boolean ret=false;
- ESBAction action=getFirstSessionBasedAction();
-
- if (action != null) {
- ret = action.isLoop();
- }
-
- return(ret);
- }
-
- /**
* This method determines whether the ESB service descriptor represents
* a 'root' conversation.
*
@@ -381,46 +305,8 @@
public boolean isRoot() {
boolean ret=false;
- if (isStateless()) {
- // Check for gateway service
- ret = isGateway();
-
- } else {
- // Determine if the root property is true
- // on the create session action
- ESBAction action=getFirstSessionBasedAction();
-
- if (action != null) {
- if (action.isSessionType()) {
- String bool=action.getPropertyValue(ROOT_PROPERTY);
- if (bool != null) {
- ret = bool.equalsIgnoreCase("true");
- } else {
- String session=action.getPropertyValue(BUSINESS_OBJECT_TYPE_PROPERTY);
-
- java.lang.annotation.Annotation annotation=
- getServiceAnnotation(session);
-
- if (annotation != null) {
- try {
- java.lang.reflect.Method method=
- annotation.getClass().getMethod(ROOT_PROPERTY,
- (Class<?>[])null);
-
- Object val=method.invoke(annotation, (Object[])null);
-
- if (val instanceof Boolean) {
- ret = ((Boolean)val).booleanValue();
- }
- } catch(Throwable t) {
- logger.log(java.util.logging.Level.SEVERE,
- "Failed to get 'root' annotation value", t);
- }
- }
- }
- }
- }
- }
+ // Check for gateway service
+ ret = isGateway();
return(ret);
}
@@ -435,12 +321,8 @@
boolean ret=false;
ESBAction action=null;
- if (isStateless()) {
- if (getActions().size() > 0) {
- action = getActions().get(0);
- }
- } else {
- action = getFirstSessionBasedAction();
+ if (getActions().size() > 0) {
+ action = getActions().get(0);
}
if (action != null) {
@@ -485,44 +367,6 @@
}
/**
- * This method determines whether the gateway service is
- * related to a stateless session.
- *
- * @return Whether the gateway service is stateless
- */
- public boolean isStateless() {
- boolean ret=false;
-
- for (int i=0; ret == false && i < m_actions.size(); i++) {
- if (m_actions.get(i).isStateless()) {
- ret = true;
- }
- }
-
- return(ret);
- }
-
- /**
- * This method returns the first session based action in the
- * service descriptor.
- *
- * @return The first session based action, or null if none exist
- */
- public ESBAction getFirstSessionBasedAction() {
- ESBAction ret=null;
-
- for (int i=0; ret == null && i < m_actions.size(); i++) {
- ret=m_actions.get(i);
-
- if (ret.isSessionBased() == false) {
- ret = null;
- }
- }
-
- return(ret);
- }
-
- /**
* This method returns the service description name associated with the
* ESB service.
*
@@ -531,44 +375,10 @@
public String getServiceDescriptionName() {
String ret=null;
- if (isStateless()) {
- ESBAction action=getGatewayAction();
-
- if (action != null) {
- ret = action.getPropertyValue(SERVICE_DESCRIPTION_NAME_PROPERTY);
- }
- } else {
- ESBAction action=getFirstSessionBasedAction();
-
- if (action != null) {
- if (action.isSessionType() || (action.getActionClass() != null &&
- action.getActionClass().equals(RETRIEVE_SESSION_ACTION_CLASS))) {
- ret = action.getPropertyValue(SERVICE_DESCRIPTION_NAME_PROPERTY);
-
- if (ret == null) {
- String session=action.getPropertyValue(BUSINESS_OBJECT_TYPE_PROPERTY);
-
- java.lang.annotation.Annotation annotation=
- getServiceAnnotation(session);
-
- if (annotation != null) {
- try {
- java.lang.reflect.Method method=
- annotation.getClass().getMethod(NAME_ATTR, (Class<?>[])null);
-
- Object val=method.invoke(annotation, (Object[])null);
-
- if (val instanceof String) {
- ret = (String)val;
- }
- } catch(Throwable t) {
- logger.log(java.util.logging.Level.SEVERE,
- "Failed to get 'name' annotation value", t);
- }
- }
- }
- }
- }
+ ESBAction action=getGatewayAction();
+
+ if (action != null) {
+ ret = action.getPropertyValue(SERVICE_DESCRIPTION_NAME_PROPERTY);
}
return(ret);
@@ -583,107 +393,14 @@
public String getConversationType() {
String ret=null;
- if (isStateless()) {
- ESBAction action=getGatewayAction();
-
- if (action != null) {
- ret = action.getPropertyValue(CONVERSATION_TYPE_PROPERTY);
- }
- } else {
- ESBAction action=getFirstSessionBasedAction();
+ ESBAction action=getGatewayAction();
- if (action != null) {
- if (action.isSessionType()) {
- ret = action.getPropertyValue(CONVERSATION_TYPE_PROPERTY);
-
- if (ret == null) {
- String session=action.getPropertyValue(BUSINESS_OBJECT_TYPE_PROPERTY);
-
- java.lang.annotation.Annotation annotation=
- getServiceAnnotation(session);
-
- if (annotation != null) {
- try {
- java.lang.reflect.Method method=
- annotation.getClass().getMethod(CONVERSATION_TYPE_PROPERTY,
- (Class<?>[])null);
-
- Object val=method.invoke(annotation, (Object[])null);
-
- if (val instanceof String) {
- ret = (String)val;
- }
- } catch(Throwable t) {
- logger.log(java.util.logging.Level.SEVERE,
- "Failed to get 'name' annotation value", t);
- }
- }
- }
- }
- }
- }
-
- return(ret);
- }
-
- /**
- * This method returns the session name associated with the service
- * descriptor.
- *
- * @return The session name
- */
- public String getSessionName() {
- String ret=null;
- ESBAction action=getFirstSessionBasedAction();
-
if (action != null) {
- ret = action.getPropertyValue(BUSINESS_OBJECT_TYPE_PROPERTY);
+ ret = action.getPropertyValue(CONVERSATION_TYPE_PROPERTY);
}
return(ret);
}
-
- /**
- * This method returns the session class associated with the service
- * descriptor.
- *
- * @return The session class
- */
- public Class<?> getSessionClass() {
- Class<?> ret=null;
- String session=getSessionName();
-
- if (session != null) {
- try {
- ClassLoader cl=
- org.jboss.savara.tools.jbossesb.model.util.ClasspathUtil.getClassLoader(getModel());
-
- ret = Class.forName(session, true, cl);
-
- } catch(Exception e) {
- logger.log(java.util.logging.Level.SEVERE,
- "Failed to get session class '"+session+"'", e);
- }
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the service is related to a behavioural
- * session.
- *
- * @return Whether the service is session based
- */
- public boolean isSessionBased() {
- boolean ret=false;
-
- for (int i=0; ret == false && i < m_actions.size(); i++) {
- ret = m_actions.get(i).isSessionBased();
- }
-
- return(ret);
- }
/**
* This method converts the ESB service into a Conversation, if
@@ -702,8 +419,8 @@
ret.derivedFrom(this);
ret.getBlock().derivedFrom(this);
- // Determine if conversation is stateless
- ret.setStateless(isStateless());
+ // Conversation is stateless
+ ret.setStateless(true);
// Configure model name
LocatedName modelName=new LocatedName();
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBAction.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBAction.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBAction.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -42,21 +42,6 @@
public void validate(ModelListener l);
/**
- * This method determines if the action represents a loop construct.
- *
- * @return Whether the action represents a loop construct
- */
- public boolean isLoop();
-
- /**
- * This method determines whether the action is related to a behavioural
- * session.
- *
- * @return Whether the action is session based
- */
- public boolean isSessionBased();
-
- /**
* This method determines whether the ESB action represents
* a new session type.
*
@@ -73,15 +58,6 @@
public boolean isGateway();
/**
- * This method determines whether a gateway action is
- * stateless. This method is only relevant when the
- * isGateway() method returns true.
- *
- * @return Whether the action is a stateless
- */
- public boolean isStateless();
-
- /**
* This method indicates whether this action performs another
* sub-conversation.
*
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBLanguageModel.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBLanguageModel.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBLanguageModel.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -126,11 +126,4 @@
*/
public String getJMSDefinition(String jmsBusId);
- /**
- * This method returns whether the model is stateless.
- *
- * @return Whether the model is stateless
- */
- public boolean isStateless();
-
}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBService.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBService.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/ESBService.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -103,14 +103,6 @@
public boolean removeAction(ESBAction action);
/**
- * This method determines whether the ESB service represents a
- * loop construct.
- *
- * @return Whether the service represents a loop
- */
- public boolean isLoop();
-
- /**
* This method determines whether the ESB service descriptor represents
* a 'root' conversation.
*
@@ -143,14 +135,6 @@
public ESBAction getGatewayAction();
/**
- * This method determines whether the gateway service is
- * related to a stateless session.
- *
- * @return Whether the gateway service is stateless
- */
- public boolean isStateless();
-
- /**
* This method returns the service description name associated with the
* ESB service.
*
@@ -167,38 +151,6 @@
public String getConversationType();
/**
- * This method returns the session name associated with the service
- * descriptor.
- *
- * @return The session name
- */
- public String getSessionName();
-
- /**
- * This method returns the session class associated with the service
- * descriptor.
- *
- * @return The session class
- */
- public Class<?> getSessionClass();
-
- /**
- * This method determines whether the service is related to a behavioural
- * session.
- *
- * @return Whether the service is session based
- */
- public boolean isSessionBased();
-
- /**
- * This method returns the first session based action in the
- * service descriptor.
- *
- * @return The first session based action, or null if none exist
- */
- public ESBAction getFirstSessionBasedAction();
-
- /**
* This method converts the actions associated with the ESB service into
* activities that can be checked for conformance against a conversation
* type.
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractESBAction.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractESBAction.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractESBAction.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -17,7 +17,7 @@
*/
package org.jboss.savara.tools.jbossesb.model.actions;
-import java.util.logging.Logger;
+//import java.util.logging.Logger;
import org.scribble.model.*;
import org.scribble.model.admin.ModelIssue;
@@ -227,27 +227,8 @@
}
}
}
-
+
/**
- * This method determines if the action represents a loop construct.
- *
- * @return Whether the action represents a loop construct
- */
- public boolean isLoop() {
- return(false);
- }
-
- /**
- * This method determines whether the action is related to a behavioural
- * session.
- *
- * @return Whether the action is session based
- */
- public boolean isSessionBased() {
- return(false);
- }
-
- /**
* This method determines whether the ESB action represents
* a new session type.
*
@@ -268,16 +249,6 @@
}
/**
- * This method determines whether the gateway service is
- * related to a stateless session.
- *
- * @return Whether the gateway service is stateless
- */
- public boolean isStateless() {
- return(false);
- }
-
- /**
* This method indicates whether this action performs another
* sub-conversation.
*
@@ -523,21 +494,6 @@
}
/**
- * This method sets the business object type property.
- *
- * @param name The business object type
- */
- public void setBusinessObjectType(String type) {
-
- org.w3c.dom.Element prop=getPropertyElement(
- DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, type);
- }
- }
-
- /**
* This method returns the XML configuration representation of the action.
*
* @return The XML configuration for the action
@@ -594,7 +550,7 @@
return(m_links);
}
- private static Logger logger =
Logger.getLogger("org.jboss.savara.tools.jbossesb.model");
+ //private static Logger logger =
Logger.getLogger("org.jboss.savara.tools.jbossesb.model");
private ESBService m_service=null;
private org.w3c.dom.Element m_action=null;
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractInteractionMessageAction.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractInteractionMessageAction.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractInteractionMessageAction.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -25,7 +25,7 @@
*
* @author gary
*/
-public abstract class AbstractInteractionMessageAction extends AbstractStatelessESBAction
{
+public abstract class AbstractInteractionMessageAction extends AbstractESBAction {
private static final long serialVersionUID = 3272234577154434603L;
Deleted:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractStatelessESBAction.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractStatelessESBAction.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/AbstractStatelessESBAction.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -1,65 +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.savara.tools.jbossesb.model.actions;
-
-import java.util.logging.Logger;
-
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-import org.jboss.savara.tools.jbossesb.model.*;
-import org.jboss.savara.tools.jbossesb.model.util.ProblemDefinitions;
-
-/**
- * This is the generic ESB action class.
- *
- * @author gary
- */
-public abstract class AbstractStatelessESBAction extends AbstractESBAction {
-
- private static final long serialVersionUID = -4436864250793029006L;
-
- /**
- * The constructor for initializing the action based on
- * an existing DOM element.
- */
- protected AbstractStatelessESBAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * The contructor for initializing a new action.
- */
- protected AbstractStatelessESBAction(ESBService service,
- String actionClass) {
- super(service, actionClass);
- }
-
- /**
- * This method determines whether the gateway service is
- * related to a stateless session.
- *
- * @return Whether the gateway service is stateless
- */
- @Override
- public boolean isStateless() {
- return(true);
- }
-
- private static Logger logger =
Logger.getLogger("org.jboss.savara.tools.jbossesb.model");
-}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/IfAction.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/IfAction.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/IfAction.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -28,7 +28,7 @@
*
* @author gary
*/
-public class IfAction extends AbstractStatelessESBAction {
+public class IfAction extends AbstractESBAction {
private static final long serialVersionUID = 9005791673502330699L;
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/Messages.properties
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/Messages.properties 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/Messages.properties 2009-08-24
20:44:21 UTC (rev 799)
@@ -17,7 +17,9 @@
# */
_IF_ORDER_WRONG=IfAction must have an 'if' path, followed by zero or more
'elseif' paths and ending with an optional 'else' path
+_NOT_SPECIFIED_PROPERTY=The property '{0}' has not been specified
_NOT_SPECIFIED_SERVICE_DETAILS=Send does not provide service category and name
_NOT_SPECIFIED_SERVICE_OR_CLIENT_ROLE=Send does not contain request service category/name
or response client role
_PATH_SERVICE_DETAILS_MISSING=One or more paths are missing the service cateogry and/or
name
_SWITCH_ONE_OR_MORE_PATHS=Switch action must specify atleast one case
+_UNKNOWN_PROPERTY=The property '{0}' is unknown
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/SwitchAction.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/SwitchAction.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/actions/SwitchAction.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -29,7 +29,7 @@
*
* @author gary
*/
-public class SwitchAction extends AbstractStatelessESBAction {
+public class SwitchAction extends AbstractESBAction {
private static final long serialVersionUID = 3765702614644769281L;
@@ -107,7 +107,7 @@
*/
@Override
public boolean isGateway() {
- return(isStateless());
+ return(true);
}
/**
@@ -118,7 +118,7 @@
*/
@Override
public boolean isSessionType() {
- return(isStateless());
+ return(true);
}
/**
Copied:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/AbstractESBModelChangeRule.java
(from rev 794,
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/AbstractStatelessESBModelChangeRule.java)
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/AbstractESBModelChangeRule.java
(rev 0)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/AbstractESBModelChangeRule.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -0,0 +1,170 @@
+/*
+ * 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.savara.tools.jbossesb.model.change;
+
+import org.jboss.savara.tools.jbossesb.model.*;
+import org.jboss.savara.tools.jbossesb.model.actions.*;
+import org.scribble.model.*;
+import org.scribble.model.change.*;
+
+/**
+ * This is the abstract stateless ESB model change rule.
+ */
+public abstract class AbstractESBModelChangeRule extends AbstractModelChangeRule {
+
+ /**
+ * This method determines whether the rule is appropriate
+ * for the supplied type of model, parent (in the context) and inserted
+ * model object.
+ *
+ * @param context The context
+ * @param model The model
+ * @param mobj The model object being inserted
+ * @param ref The optional reference model object
+ * @return Whether the rule supports the supplied information
+ */
+ @Override
+ public boolean isInsertSupported(ModelChangeContext context,
+ Model model, ModelObject mobj, ModelObject ref) {
+ boolean ret=false;
+
+ if ((context.getParent() instanceof ESBService ||
+ (ref != null && ref.getSource().getObject()
+ instanceof AbstractESBAction &&
+ ((AbstractESBAction)ref.getSource().getObject()).getService() != null)) &&
+ model instanceof ESBLanguageModel) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the ESB service associated with the
+ * optional model object reference or the context.
+ *
+ * @param context The context
+ * @param ref The optional model object
+ * @return The ESB service, or null if not found
+ */
+ protected ESBService getESBService(ModelChangeContext context,
+ ModelObject ref) {
+ ESBService ret=(ESBService)context.getParent();
+
+ if (ref != null && ref.getSource().getObject() instanceof AbstractESBAction) {
+ ret = ((AbstractESBAction)ref.getSource().getObject()).getService();
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines the position of the supplied
+ * model object within the supplied service.
+ *
+ * @param service The service
+ * @param ref The optional model object
+ * @return The position, or -1 if not found
+ */
+ protected int getPosition(ESBService service, ModelObject ref) {
+ int ret=-1;
+
+ // Check if reference model object provided, and if so,
+ // if it has a position within the service
+ if (ref != null && ref.getSource().getObject() instanceof ESBAction) {
+ ret = service.getActions().indexOf((ESBAction)
+ ref.getSource().getObject());
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines whether the rule is appropriate
+ * for the supplied type of model, parent (in the context)
+ * and deleted model object.
+ *
+ * @param context The context
+ * @param model The model
+ * @param mobj The model object to be removed
+ * @return Whether the rule supports the supplied information
+ */
+ @Override
+ public boolean isDeleteSupported(ModelChangeContext context,
+ Model model, ModelObject mobj) {
+ boolean ret=false;
+
+ if (mobj.getSource().getObject() instanceof AbstractESBAction &&
+ (context.getParent() instanceof ESBService ||
+ ((AbstractESBAction)mobj.getSource().getObject()).getService() != null) &&
+ model instanceof ESBLanguageModel) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method removes the supplied model object from the
+ * supplied model. The model object representation must
+ * contain the necessary model specific to remove the
+ * object from the underlying model representation.
+ *
+ * @param context The context
+ * @param model The model being changed
+ * @param mobj The model object to be deleted
+ * @return Whether the change has been applied
+ */
+ @Override
+ public boolean delete(ModelChangeContext context,
+ Model model, ModelObject mobj) {
+ boolean ret=false;
+ ESBService service=getESBService(context, mobj);
+ ESBAction action=(ESBAction)mobj.getSource().getObject();
+
+ if (action != null && service != null) {
+ ret = service.getActions().remove(action);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines whether the rule is appropriate
+ * for the supplied type of model, parent (in the context)
+ * and modified model object.
+ *
+ * @param context The context
+ * @param model The model
+ * @param fromObj The source model object
+ * @param toObj The model object to be updated
+ * @return Whether the rule supports the supplied information
+ */
+ @Override
+ public boolean isUpdateSupported(ModelChangeContext context,
+ Model model, ModelObject fromObj, ModelObject toObj) {
+ boolean ret=false;
+
+ if (context.getParent() instanceof ESBService &&
+ model instanceof ESBLanguageModel) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+}
Deleted:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/AbstractStatelessESBModelChangeRule.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/AbstractStatelessESBModelChangeRule.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/AbstractStatelessESBModelChangeRule.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -1,173 +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.savara.tools.jbossesb.model.change;
-
-import org.jboss.savara.tools.jbossesb.model.*;
-import org.jboss.savara.tools.jbossesb.model.actions.*;
-import org.scribble.model.*;
-import org.scribble.model.change.*;
-
-/**
- * This is the abstract stateless ESB model change rule.
- */
-public abstract class AbstractStatelessESBModelChangeRule extends AbstractModelChangeRule
{
-
- /**
- * This method determines whether the rule is appropriate
- * for the supplied type of model, parent (in the context) and inserted
- * model object.
- *
- * @param context The context
- * @param model The model
- * @param mobj The model object being inserted
- * @param ref The optional reference model object
- * @return Whether the rule supports the supplied information
- */
- @Override
- public boolean isInsertSupported(ModelChangeContext context,
- Model model, ModelObject mobj, ModelObject ref) {
- boolean ret=false;
-
- if ((context.getParent() instanceof ESBService ||
- (ref != null && ref.getSource().getObject()
- instanceof AbstractESBAction &&
- ((AbstractESBAction)ref.getSource().getObject()).getService() != null)) &&
- model instanceof ESBLanguageModel &&
- ((ESBLanguageModel)model).isStateless()) {
- ret = true;
- }
-
- return(ret);
- }
-
- /**
- * This method returns the ESB service associated with the
- * optional model object reference or the context.
- *
- * @param context The context
- * @param ref The optional model object
- * @return The ESB service, or null if not found
- */
- protected ESBService getESBService(ModelChangeContext context,
- ModelObject ref) {
- ESBService ret=(ESBService)context.getParent();
-
- if (ref != null && ref.getSource().getObject() instanceof AbstractESBAction) {
- ret = ((AbstractESBAction)ref.getSource().getObject()).getService();
- }
-
- return(ret);
- }
-
- /**
- * This method determines the position of the supplied
- * model object within the supplied service.
- *
- * @param service The service
- * @param ref The optional model object
- * @return The position, or -1 if not found
- */
- protected int getPosition(ESBService service, ModelObject ref) {
- int ret=-1;
-
- // Check if reference model object provided, and if so,
- // if it has a position within the service
- if (ref != null && ref.getSource().getObject() instanceof ESBAction) {
- ret = service.getActions().indexOf((ESBAction)
- ref.getSource().getObject());
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the rule is appropriate
- * for the supplied type of model, parent (in the context)
- * and deleted model object.
- *
- * @param context The context
- * @param model The model
- * @param mobj The model object to be removed
- * @return Whether the rule supports the supplied information
- */
- @Override
- public boolean isDeleteSupported(ModelChangeContext context,
- Model model, ModelObject mobj) {
- boolean ret=false;
-
- if (mobj.getSource().getObject() instanceof AbstractESBAction &&
- (context.getParent() instanceof ESBService ||
- ((AbstractESBAction)mobj.getSource().getObject()).getService() != null) &&
- model instanceof ESBLanguageModel &&
- ((ESBLanguageModel)model).isStateless()) {
- ret = true;
- }
-
- return(ret);
- }
-
- /**
- * This method removes the supplied model object from the
- * supplied model. The model object representation must
- * contain the necessary model specific to remove the
- * object from the underlying model representation.
- *
- * @param context The context
- * @param model The model being changed
- * @param mobj The model object to be deleted
- * @return Whether the change has been applied
- */
- @Override
- public boolean delete(ModelChangeContext context,
- Model model, ModelObject mobj) {
- boolean ret=false;
- ESBService service=getESBService(context, mobj);
- ESBAction action=(ESBAction)mobj.getSource().getObject();
-
- if (action != null && service != null) {
- ret = service.getActions().remove(action);
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the rule is appropriate
- * for the supplied type of model, parent (in the context)
- * and modified model object.
- *
- * @param context The context
- * @param model The model
- * @param fromObj The source model object
- * @param toObj The model object to be updated
- * @return Whether the rule supports the supplied information
- */
- @Override
- public boolean isUpdateSupported(ModelChangeContext context,
- Model model, ModelObject fromObj, ModelObject toObj) {
- boolean ret=false;
-
- if (context.getParent() instanceof ESBService &&
- model instanceof ESBLanguageModel &&
- ((ESBLanguageModel)model).isStateless()) {
- ret = true;
- }
-
- return(ret);
- }
-}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/ConversationInteractionModelChangeRule.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/ConversationInteractionModelChangeRule.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/ConversationInteractionModelChangeRule.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -33,7 +33,7 @@
* This is the model change rule for the Conversation Interaction.
*/
@RegistryInfo(extension=ModelChangeRule.class,notation=JBossESBNotation.NOTATION_CODE)
-public class ConversationInteractionModelChangeRule extends
AbstractStatelessESBModelChangeRule {
+public class ConversationInteractionModelChangeRule extends AbstractESBModelChangeRule {
/**
* This method determines whether the rule is appropriate
@@ -142,12 +142,6 @@
service.addAction(action, pos);
- if (((ESBService)context.getParent()).getFirstSessionBasedAction() == action
&&
- interaction.getEnclosingDefinition() instanceof Conversation) {
- action.setBusinessObjectType(ConversationUtil.getBusinessObjectType(
- ((Conversation)interaction.getEnclosingDefinition())));
- }
-
if (interaction.getReplyToLabel() != null) {
if (interaction.getToRole() != null) {
@@ -336,12 +330,6 @@
endService.addAction(action, endPos);
- if (endService.getFirstSessionBasedAction() == action &&
- interaction.getEnclosingDefinition() instanceof Conversation) {
- action.setBusinessObjectType(ConversationUtil.getBusinessObjectType(
- ((Conversation)interaction.getEnclosingDefinition())));
- }
-
// Check if subsequent initiator found, requiring
// a new service
/* IS STILL REQUIRED?
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/ConversationModelChangeRule.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/ConversationModelChangeRule.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/ConversationModelChangeRule.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -49,8 +49,7 @@
boolean ret=false;
if (mobj instanceof Conversation &&
- model instanceof ESBLanguageModel &&
- ((ESBLanguageModel)model).isStateless()) {
+ model instanceof ESBLanguageModel) {
ret = true;
}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/IfModelChangeRule.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/IfModelChangeRule.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/IfModelChangeRule.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -34,7 +34,7 @@
* This is the model change rule for the If grouping construct.
*/
@RegistryInfo(extension=ModelChangeRule.class,notation=JBossESBNotation.NOTATION_CODE)
-public class IfModelChangeRule extends AbstractStatelessESBModelChangeRule {
+public class IfModelChangeRule extends AbstractESBModelChangeRule {
private static final String NAME_SUFFIX = "_main";
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/LanguageToConversationModelChangeRule.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/LanguageToConversationModelChangeRule.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/LanguageToConversationModelChangeRule.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -47,8 +47,7 @@
boolean ret=false;
if (mobj instanceof ConversationModel &&
- model instanceof ESBLanguageModel &&
- ((ESBLanguageModel)model).isStateless()) {
+ model instanceof ESBLanguageModel) {
ret = true;
}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/TypeReferenceModelChangeRule.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/TypeReferenceModelChangeRule.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/model/change/TypeReferenceModelChangeRule.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -50,8 +50,7 @@
if (fromObj instanceof TypeReference &&
toObj instanceof TypeReference &&
- model instanceof ESBLanguageModel &&
- ((ESBLanguageModel)model).isStateless() == true) {
+ model instanceof ESBLanguageModel) {
ret = true;
}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/plugintest/org/jboss/savara/tools/jbossesb/generator/GeneratorTest.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/plugintest/org/jboss/savara/tools/jbossesb/generator/GeneratorTest.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/plugintest/org/jboss/savara/tools/jbossesb/generator/GeneratorTest.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -108,13 +108,15 @@
defn = defns.get(0);
}
- if (generator != null && defn != null) {
+ if (cm.getConversation().isStateless() == false) {
+ result.addError(this, new Throwable("Only currently support stateless
conversations: "+filename));
+
+ } else if (generator != null && defn != null) {
ModelReference targetRef=
new ModelReference(JBossESBNotation.NOTATION_CODE);
DefaultESBLanguageModel target=
- new DefaultESBLanguageModel(targetRef,
- cm.getConversation().isStateless());
+ new DefaultESBLanguageModel(targetRef);
generator.generate(targetRef,
defn.getLocatedName().getRole(),
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/DefaultESBLanguageModelTest.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/DefaultESBLanguageModelTest.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/DefaultESBLanguageModelTest.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -30,7 +30,7 @@
ModelReference ref=new ModelReference(JBossESBNotation.NOTATION_CODE);
- DefaultESBLanguageModel model=new DefaultESBLanguageModel(ref, false);
+ DefaultESBLanguageModel model=new DefaultESBLanguageModel(ref);
org.w3c.dom.Element config=model.getESBConfiguration();
@@ -114,7 +114,7 @@
ModelReference ref=new ModelReference(JBossESBNotation.NOTATION_CODE);
- DefaultESBLanguageModel model=new DefaultESBLanguageModel(ref, false);
+ DefaultESBLanguageModel model=new DefaultESBLanguageModel(ref);
org.w3c.dom.Element config=model.getESBConfiguration();
@@ -176,7 +176,7 @@
ModelReference ref=new ModelReference(JBossESBNotation.NOTATION_CODE);
- DefaultESBLanguageModel model=new DefaultESBLanguageModel(ref, false);
+ DefaultESBLanguageModel model=new DefaultESBLanguageModel(ref);
org.w3c.dom.Element config=model.getESBConfiguration();
@@ -222,7 +222,7 @@
ModelReference ref=new ModelReference(JBossESBNotation.NOTATION_CODE);
- DefaultESBLanguageModel model=new DefaultESBLanguageModel(ref, false);
+ DefaultESBLanguageModel model=new DefaultESBLanguageModel(ref);
TestESBService service=new TestESBService();
service.setCategory(category);
@@ -242,7 +242,7 @@
ModelReference ref=new ModelReference(JBossESBNotation.NOTATION_CODE);
- DefaultESBLanguageModel model=new DefaultESBLanguageModel(ref, false);
+ DefaultESBLanguageModel model=new DefaultESBLanguageModel(ref);
TestESBService service1=new TestESBService();
service1.setCategory(category);
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/DefaultESBServiceTest.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/DefaultESBServiceTest.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/DefaultESBServiceTest.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -24,135 +24,20 @@
public class DefaultESBServiceTest extends TestCase {
- public void testValidateSessionClassRequired() {
+ public void testIsSessionType() {
DefaultESBService service=new DefaultESBService(null, null);
TestESBAction act1=new TestESBAction();
- act1.setSessionBased(true);
+ act1.isSessionType(true);
service.getActions().add(act1);
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.savara.tools.jbossesb.model.Messages"),
- "_NOT_SPECIFIED_SESSION_CLASS",
- new String[]{}));
-
- service.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testValidateSessionClassNotRequired() {
- DefaultESBService service=new DefaultESBService(null, null);
-
- TestModelListener l=new TestModelListener();
-
- service.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
- public void testIsLoop() {
- DefaultESBService service=new DefaultESBService(null, null);
-
- TestESBAction act1=new TestESBAction();
- act1.setSessionBased(true);
- act1.setLoop(true);
-
- service.getActions().add(act1);
-
- if (service.isLoop() == false) {
- fail("Service should be loop");
- }
- }
-
- public void testIsLoopFalse() {
- DefaultESBService service=new DefaultESBService(null, null);
-
- TestESBAction act1=new TestESBAction();
- act1.setSessionBased(true);
-
- service.getActions().add(act1);
-
- if (service.isLoop()) {
- fail("Service is not a loop");
- }
- }
-
- public void testIsRoot() {
- DefaultESBService service=new DefaultESBService(null, null);
-
- TestESBAction act1=new TestESBAction();
- act1.setSessionBased(true);
- act1.setCreateSession(true);
- act1.setPropertyValue(DefaultESBService.ROOT_PROPERTY, "true");
-
- service.getActions().add(act1);
-
- if (service.isRoot() == false) {
- fail("Service should be root");
- }
- }
-
- public void testIsRootFalse() {
- DefaultESBService service=new DefaultESBService(null, null);
-
- TestESBAction act1=new TestESBAction();
-
- service.getActions().add(act1);
-
- if (service.isRoot()) {
- fail("Service should NOT be root");
- }
- }
-
- public void testIsSessionBased() {
- DefaultESBService service=new DefaultESBService(null, null);
-
- TestESBAction act1=new TestESBAction();
- act1.setSessionBased(true);
-
- service.getActions().add(act1);
-
- if (service.isSessionBased() == false) {
- fail("Service should be SessionBased");
- }
- }
-
- public void testIsSessionBasedFalse() {
- DefaultESBService service=new DefaultESBService(null, null);
-
- TestESBAction act1=new TestESBAction();
-
- service.getActions().add(act1);
-
- if (service.isSessionBased()) {
- fail("Service should NOT be SessionBased");
- }
- }
-
- public void testIsCreateSession() {
- DefaultESBService service=new DefaultESBService(null, null);
-
- TestESBAction act1=new TestESBAction();
- act1.setSessionBased(true);
- act1.setCreateSession(true);
-
- service.getActions().add(act1);
-
if (service.isSessionType() == false) {
- fail("Service should be 'create session'");
+ fail("Service should be 'session type'");
}
}
- public void testIsCreateSessionFalse() {
+ public void testIsSessionTypeFalse() {
DefaultESBService service=new DefaultESBService(null, null);
TestESBAction act1=new TestESBAction();
@@ -160,7 +45,7 @@
service.getActions().add(act1);
if (service.isSessionType()) {
- fail("Service should NOT be 'create session'");
+ fail("Service should NOT be 'session type'");
}
}
@@ -170,8 +55,8 @@
DefaultESBService service=new DefaultESBService(null, null);
TestESBAction act1=new TestESBAction();
- act1.setSessionBased(true);
- act1.setCreateSession(true);
+ act1.isSessionType(true);
+ act1.setGateway(true);
act1.setPropertyValue(DefaultESBService.SERVICE_DESCRIPTION_NAME_PROPERTY,
name);
@@ -189,8 +74,8 @@
DefaultESBService service=new DefaultESBService(null, null);
TestESBAction act1=new TestESBAction();
- act1.setSessionBased(true);
- act1.setCreateSession(true);
+ act1.isSessionType(true);
+ act1.setGateway(true);
act1.setPropertyValue(DefaultESBService.CONVERSATION_TYPE_PROPERTY,
name);
@@ -202,24 +87,6 @@
}
}
- public void testGetSessionName() {
- String name="session1";
-
- DefaultESBService service=new DefaultESBService(null, null);
-
- TestESBAction act1=new TestESBAction();
- act1.setSessionBased(true);
- act1.setPropertyValue(DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY,
- name);
-
- service.getActions().add(act1);
-
- if (service.getSessionName().equals(name) == false) {
- fail("Session name '"+service.getSessionName()+
- "' invalid, expecting: "+name);
- }
- }
-
public void testBaseConfiguration() {
String category="category";
String name="name";
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/TestESBAction.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/TestESBAction.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/TestESBAction.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -63,43 +63,25 @@
m_initiator = initiator;
}
- public boolean isLoop() {
- return(m_loop);
- }
-
- public void setLoop(boolean bool) {
- m_loop = bool;
- }
-
public boolean isPerform() {
// TODO Auto-generated method stub
return false;
}
- public boolean isSessionBased() {
- return(m_sessionBased);
- }
-
- public void setSessionBased(boolean bool) {
- m_sessionBased = bool;
- }
-
public boolean isSessionType() {
- return(m_createSession);
+ return(m_sessionType);
}
- public void setCreateSession(boolean bool) {
- m_createSession = bool;
+ public void isSessionType(boolean bool) {
+ m_sessionType = bool;
}
public boolean isGateway() {
- // TODO Auto-generated method stub
- return false;
+ return(m_gateway);
}
-
- public boolean isStateless() {
- // TODO Auto-generated method stub
- return false;
+
+ public void setGateway(boolean bool) {
+ m_gateway = bool;
}
public boolean hasProperty(String property) {
@@ -112,9 +94,8 @@
}
- private boolean m_sessionBased=false;
- private boolean m_loop=false;
private boolean m_initiator=false;
- private boolean m_createSession=false;
+ private boolean m_sessionType=false;
+ private boolean m_gateway=false;
private java.util.Map<String,String> m_property=new java.util.Hashtable<String,
String>();
}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/IfActionTest.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/IfActionTest.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/IfActionTest.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -619,14 +619,4 @@
fail("Action is flagged as a 'CreateSession'");
}
}
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- IfAction action=new IfAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/ReceiveMessageActionTest.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/ReceiveMessageActionTest.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/ReceiveMessageActionTest.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -30,7 +30,6 @@
service.setRoot(true);
java.util.Map<String,String> props=new
java.util.Hashtable<String,String>();
- props.put("identities", "");
org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
@@ -53,34 +52,6 @@
}
}
- public void testValidateNoIdentities() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new
java.util.Hashtable<String,String>();
- props.put("messageType", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- ReceiveMessageAction action=new ReceiveMessageAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.savara.tools.jbossesb.model.actions.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"identities"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
public void testConvertRoles() {
TestESBService service=new TestESBService();
@@ -274,14 +245,4 @@
fail("Action is flagged as a 'CreateSession'");
}
}
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- ReceiveMessageAction action=new ReceiveMessageAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/SendMessageActionTest.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/SendMessageActionTest.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/SendMessageActionTest.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -35,9 +35,8 @@
service.setRoot(true);
java.util.Map<String,String> props=new
java.util.Hashtable<String,String>();
- props.put("identities", "");
- props.put("serviceCategory", "");
- props.put("serviceName", "");
+ props.put(SendMessageAction.SERVICE_CATEGORY, "x");
+ props.put(SendMessageAction.SERVICE_NAME, "y");
org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
@@ -60,42 +59,12 @@
}
}
- public void testValidateNoIdentities() {
- TestESBService service=new TestESBService();
- service.setRoot(true);
-
- java.util.Map<String,String> props=new
java.util.Hashtable<String,String>();
- props.put("messageType", "");
- props.put("clientRole", "");
-
- org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
-
- SendMessageAction action=new SendMessageAction(service, elem);
-
- service.getActions().add(action);
-
- TestModelListener l=new TestModelListener();
-
- l.addExpectedError(org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.savara.tools.jbossesb.model.actions.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{"identities"}));
-
- action.validate(l);
-
- if (l.isValid() == false) {
- fail(l.invalidMessage());
- }
- }
-
public void testValidateNoDestination() {
TestESBService service=new TestESBService();
service.setRoot(true);
java.util.Map<String,String> props=new
java.util.Hashtable<String,String>();
props.put("messageType", "");
- props.put("identities", "");
org.w3c.dom.Element elem=ESBActionTestUtil.getAction(null, props, null);
@@ -108,7 +77,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
"org.jboss.savara.tools.jbossesb.model.actions.Messages"),
- "_NOT_SPECIFIED_REQ_RESP_EPR",
+ "_NOT_SPECIFIED_SERVICE_OR_CLIENT_ROLE",
new String[]{}));
action.validate(l);
@@ -118,13 +87,13 @@
}
}
+ /*
public void testValidateResponseService() {
TestESBService service=new TestESBService();
service.setRoot(true);
java.util.Map<String,String> props=new
java.util.Hashtable<String,String>();
props.put("messageType", "");
- props.put("identities", "");
props.put("serviceCategory", "cat1");
props.put("serviceName", "name1");
props.put("responseServiceCategory", "cat2");
@@ -156,6 +125,7 @@
fail(l.invalidMessage());
}
}
+ */
public void testConvertRoles() {
TestESBService service=new TestESBService();
@@ -350,14 +320,4 @@
fail("Action is flagged as a 'CreateSession'");
}
}
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- SendMessageAction action=new SendMessageAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/SwitchActionTest.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/SwitchActionTest.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/actions/SwitchActionTest.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -183,7 +183,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.savara.tools.jbossesb.model.stateful.actions.Messages"),
+ "org.jboss.savara.tools.jbossesb.model.actions.Messages"),
"_PATH_SERVICE_DETAILS_MISSING",
new String[]{}));
@@ -365,18 +365,8 @@
SwitchAction action=new SwitchAction(service, null);
- if (action.isSessionType() == true) {
- fail("Action is flagged as a 'CreateSession'");
+ if (action.isSessionType() == false) {
+ fail("Should be a session type");
}
}
-
- public void testIsSessionBased() {
- TestESBService service=new TestESBService();
-
- SwitchAction action=new SwitchAction(service, null);
-
- if (action.isSessionBased() == false) {
- fail("Action is not flagged as a 'SessionBased'");
- }
- }
}
Modified:
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/change/ConversationInteractionModelChangeRuleTest.java
===================================================================
---
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/change/ConversationInteractionModelChangeRuleTest.java 2009-08-24
20:41:24 UTC (rev 798)
+++
cdl/trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/test/org/jboss/savara/tools/jbossesb/model/change/ConversationInteractionModelChangeRuleTest.java 2009-08-24
20:44:21 UTC (rev 799)
@@ -29,6 +29,9 @@
public class ConversationInteractionModelChangeRuleTest extends TestCase {
+ public void testPlaceHolder() {
+ }
+
/*
public void testInsertFirstReceiveAction() {
ConversationInteractionModelChangeRule rule=new
ConversationInteractionModelChangeRule();