Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Struckmann2014-10-16 07:13:36 +0000
committerSebastian Struckmann2014-10-16 07:20:46 +0000
commit9e7e73edeccf3d24773359e0e82681511b210af7 (patch)
treed7edcc2c32e0fc92155d1320328876cab3edd344 /org.eclipse.jubula.client.api
parentb09e2d60c6e32671329e5630993d4f1ae5a80c61 (diff)
downloadorg.eclipse.jubula.core-9e7e73edeccf3d24773359e0e82681511b210af7.tar.gz
org.eclipse.jubula.core-9e7e73edeccf3d24773359e0e82681511b210af7.tar.xz
org.eclipse.jubula.core-9e7e73edeccf3d24773359e0e82681511b210af7.zip
Sprint task - Java API - Moved initialization of ObjectMapping into constructor
Diffstat (limited to 'org.eclipse.jubula.client.api')
-rw-r--r--org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/MakeR.java9
-rw-r--r--org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/ObjectMapping.java (renamed from org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/OM.java)11
-rw-r--r--org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/ObjectMappingImpl.java (renamed from org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/ObjectMappingLoader.java)17
3 files changed, 14 insertions, 23 deletions
diff --git a/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/MakeR.java b/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/MakeR.java
index 50e8cf6f6..874ac00b7 100644
--- a/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/MakeR.java
+++ b/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/MakeR.java
@@ -10,8 +10,10 @@
*******************************************************************************/
package org.eclipse.jubula.client;
+import java.io.InputStream;
+
import org.eclipse.jubula.client.internal.impl.AUTAgentImpl;
-import org.eclipse.jubula.client.internal.impl.ObjectMappingLoader;
+import org.eclipse.jubula.client.internal.impl.ObjectMappingImpl;
/** @author BREDEX GmbH */
public final class MakeR {
@@ -33,8 +35,9 @@ public final class MakeR {
/**
* @return a new Object Mapping instance
+ * @param input the input stream containing the encoded object mapping
*/
- public static OM createOM() {
- return new ObjectMappingLoader();
+ public static ObjectMapping createObjectMapping(InputStream input) {
+ return new ObjectMappingImpl(input);
}
} \ No newline at end of file
diff --git a/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/OM.java b/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/ObjectMapping.java
index 5cd85e4a1..479cbb294 100644
--- a/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/OM.java
+++ b/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/ObjectMapping.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.jubula.client;
-import java.net.URL;
-
import org.eclipse.jubula.tools.ComponentIdentifier;
/**
@@ -20,14 +18,7 @@ import org.eclipse.jubula.tools.ComponentIdentifier;
* @author BREDEX GmbH
* @created Oct 13, 2014
*/
-public interface OM {
- /**
- * Initializes the object mapping associations
- *
- * @param resourceURL
- * the URL to the resource properties file
- */
- public void init(URL resourceURL);
+public interface ObjectMapping {
/**
* Returns the component identifier for a component name from the cache
diff --git a/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/ObjectMappingLoader.java b/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/ObjectMappingImpl.java
index a528791c1..93a5c8cd6 100644
--- a/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/ObjectMappingLoader.java
+++ b/org.eclipse.jubula.client.api/src/org/eclipse/jubula/client/internal/impl/ObjectMappingImpl.java
@@ -11,12 +11,12 @@
package org.eclipse.jubula.client.internal.impl;
import java.io.IOException;
-import java.net.URL;
+import java.io.InputStream;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
-import org.eclipse.jubula.client.OM;
+import org.eclipse.jubula.client.ObjectMapping;
import org.eclipse.jubula.client.exceptions.LoadResourceException;
import org.eclipse.jubula.client.internal.utils.SerilizationUtils;
import org.eclipse.jubula.tools.ComponentIdentifier;
@@ -28,10 +28,10 @@ import org.slf4j.LoggerFactory;
* @author BREDEX GmbH
* @created Oct 09, 2014
*/
-public class ObjectMappingLoader implements OM {
+public class ObjectMappingImpl implements ObjectMapping {
/** the logger */
private static Logger log = LoggerFactory.getLogger(
- ObjectMappingLoader.class);
+ ObjectMappingImpl.class);
/** object mapping associations */
private Properties m_objectMappingAssociations = new Properties();
@@ -42,15 +42,12 @@ public class ObjectMappingLoader implements OM {
/**
* Utility class for loading object mapping association
+ * @param input the input stream containing the encoded object mapping
*/
- public ObjectMappingLoader() {
+ public ObjectMappingImpl(InputStream input) {
super();
- }
-
- /** {@inheritDoc} */
- public void init (URL resourceURL) {
try {
- m_objectMappingAssociations.load(resourceURL.openStream());
+ m_objectMappingAssociations.load(input);
for (Object obj : m_objectMappingAssociations.keySet()) {
if (obj instanceof String) {
String compName = (String) obj;

Back to the top