Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2014-10-14 10:27:20 +0000
committerMarkus Tiede2014-10-15 07:18:20 +0000
commit1190537ec1cb4bfe3c487a574745f249e4f5493d (patch)
tree38879e4326a90848ea7ac87bb3c5ed3a39509b5c /org.eclipse.jubula.client.api
parenta058672a193feb5072a84317dc093877d4c4cff5 (diff)
downloadorg.eclipse.jubula.core-1190537ec1cb4bfe3c487a574745f249e4f5493d.tar.gz
org.eclipse.jubula.core-1190537ec1cb4bfe3c487a574745f249e4f5493d.tar.xz
org.eclipse.jubula.core-1190537ec1cb4bfe3c487a574745f249e4f5493d.zip
Sprint task - provide API: implement connect to AUT via API - part 4: first steps to POC for CAP execution.
Diffstat (limited to 'org.eclipse.jubula.client.api')
-rw-r--r--org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/AUT.java7
-rw-r--r--org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/AUTImpl.java32
2 files changed, 38 insertions, 1 deletions
diff --git a/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/AUT.java b/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/AUT.java
index 20542d517..19dc0c64e 100644
--- a/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/AUT.java
+++ b/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/AUT.java
@@ -12,6 +12,7 @@ package org.eclipse.jubula.client;
import java.util.Map;
+import org.eclipse.jubula.communication.internal.message.MessageCap;
import org.eclipse.jubula.tools.internal.registration.AutIdentifier;
/** @author BREDEX GmbH */
@@ -26,4 +27,10 @@ public interface AUT extends Remote {
* the type mapping to set
*/
void setTypeMapping(Map<?, ?> typeMapping);
+
+ /**
+ * @param cap
+ * the CAP to execute on the AUT
+ */
+ void execute(MessageCap cap);
} \ No newline at end of file
diff --git a/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/AUTImpl.java b/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/AUTImpl.java
index 1ffaa74d4..2a47bb661 100644
--- a/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/AUTImpl.java
+++ b/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/AUTImpl.java
@@ -14,12 +14,23 @@ import java.util.Map;
import org.eclipse.jubula.client.AUT;
import org.eclipse.jubula.client.internal.AUTConnection;
+import org.eclipse.jubula.client.internal.BaseConnection.NotConnectedException;
+import org.eclipse.jubula.communication.internal.message.CAPTestMessage;
+import org.eclipse.jubula.communication.internal.message.CAPTestMessageFactory;
+import org.eclipse.jubula.communication.internal.message.MessageCap;
+import org.eclipse.jubula.communication.internal.message.UnknownMessageException;
import org.eclipse.jubula.tools.internal.exception.Assert;
+import org.eclipse.jubula.tools.internal.exception.CommunicationException;
import org.eclipse.jubula.tools.internal.registration.AutIdentifier;
import org.eclipse.jubula.tools.internal.xml.businessmodell.ComponentClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** @author BREDEX GmbH */
public class AUTImpl implements AUT {
+ /** the logger */
+ private static Logger log = LoggerFactory.getLogger(AUTAgentImpl.class);
+
/** the AUT identifier */
private AutIdentifier m_autID;
/** the instance */
@@ -55,7 +66,6 @@ public class AUTImpl implements AUT {
return m_instance != null ? m_instance.isConnected() : false;
}
-
/** {@inheritDoc} */
public AutIdentifier getIdentifier() {
return m_autID;
@@ -74,4 +84,24 @@ public class AUTImpl implements AUT {
public void setTypeMapping(Map<?, ?> typeMapping) {
m_typeMapping = (Map<ComponentClass, String>) typeMapping;
}
+
+ /** {@inheritDoc} */
+ public void execute(MessageCap cap) {
+ try {
+ // TODO MT: fixme
+ CAPTestMessage capTestMessage = CAPTestMessageFactory
+ .getCAPTestMessage(cap,
+ "com.bredexsw.guidancer.SwtToolkitPlugin"); //$NON-NLS-1$
+
+ m_instance.send(capTestMessage);
+ } catch (UnknownMessageException e) {
+ log.error(e.getLocalizedMessage(), e);
+ } catch (NotConnectedException e) {
+ log.error(e.getLocalizedMessage(), e);
+ } catch (IllegalArgumentException e) {
+ log.error(e.getLocalizedMessage(), e);
+ } catch (CommunicationException e) {
+ log.error(e.getLocalizedMessage(), e);
+ }
+ }
} \ No newline at end of file

Back to the top