Author: vhalbert(a)redhat.com
Date: 2009-05-07 19:17:29 -0400 (Thu, 07 May 2009)
New Revision: 889
Modified:
trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java
trunk/server/src/test/java/com/metamatrix/admin/server/TestServerConfigAdminImpl.java
Log:
JBEDSP-977 - converting importcb to use admin. Add new testcase
Modified:
trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java
===================================================================
---
trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java 2009-05-07
23:15:39 UTC (rev 888)
+++
trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java 2009-05-07
23:17:29 UTC (rev 889)
@@ -78,6 +78,7 @@
public class FakeConfigurationService implements ConfigurationServiceInterface {
private String CONFIG_FILE_PATH = null;
+ private ConnectorBinding cb = null;
private ConfigurationModelContainerImpl config;
public FakeConfigurationService() {
@@ -554,7 +555,12 @@
String vmName,
String principalName,
Properties properties) throws
ConfigurationException {
- return null;
+
+ BasicConfigurationObjectEditor editor = new BasicConfigurationObjectEditor(false);
+ ComponentTypeID id = new ComponentTypeID(connectorType);
+
+ this.cb = editor.createConnectorComponent(Configuration.NEXT_STARTUP_ID, id,
connectorBindingName, null);
+ return cb;
}
/**
Modified:
trunk/server/src/test/java/com/metamatrix/admin/server/TestServerConfigAdminImpl.java
===================================================================
---
trunk/server/src/test/java/com/metamatrix/admin/server/TestServerConfigAdminImpl.java 2009-05-07
23:15:39 UTC (rev 888)
+++
trunk/server/src/test/java/com/metamatrix/admin/server/TestServerConfigAdminImpl.java 2009-05-07
23:17:29 UTC (rev 889)
@@ -31,6 +31,8 @@
import com.metamatrix.admin.api.exception.AdminException;
import com.metamatrix.admin.api.exception.AdminProcessingException;
+import com.metamatrix.admin.api.objects.AdminOptions;
+import com.metamatrix.admin.api.objects.ConnectorBinding;
import com.metamatrix.admin.api.objects.Host;
import com.metamatrix.core.util.ObjectConverterUtil;
import com.metamatrix.core.util.UnitTestUtil;
@@ -143,7 +145,21 @@
char[] data = ObjectConverterUtil.convertFileToCharArray(file, null);
admin.addConnectorType(name, data);
- }
+ }
+
+ public void testAddConnectorBindingUsingNameInCDK() throws Exception {
+ String cdkFileName = "GateaConnector.cdk"; //$NON-NLS-1$
+
+ final String datapath = UnitTestUtil.getTestDataPath();
+ final String fullpathName = datapath + File.separator + "config" +
File.separator + cdkFileName;
+
+ File file = new File(fullpathName);
+
+ char[] data = ObjectConverterUtil.convertFileToCharArray(file, null);
+ ConnectorBinding cb = admin.addConnectorBinding("", data, new
AdminOptions(AdminOptions.OnConflict.OVERWRITE));
+ assertNotNull(cb);
+
+ }
public void testAddHost() throws Exception {
String hostIdentifier = BOGUS_HOST;
Show replies by date