Author: rareddy
Date: 2010-11-11 14:56:29 -0500 (Thu, 11 Nov 2010)
New Revision: 2718
Modified:
branches/7.1.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java
branches/7.1.x/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
branches/7.1.x/test-integration/db/src/test/resources/TransactionsRevisited.vdb
Log:
TEIID-1356: Enum type was not being properly handled to wrap into metavalue.
Modified:
branches/7.1.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java
===================================================================
---
branches/7.1.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java 2010-11-09
22:45:31 UTC (rev 2717)
+++
branches/7.1.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java 2010-11-11
19:56:29 UTC (rev 2718)
@@ -43,11 +43,13 @@
import org.jboss.managed.api.ManagedCommon;
import org.jboss.managed.api.ManagedOperation;
import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.types.EnumMetaType;
import org.jboss.metatype.api.types.MapCompositeMetaType;
import org.jboss.metatype.api.types.MetaType;
import org.jboss.metatype.api.types.SimpleMetaType;
import org.jboss.metatype.api.values.CollectionValue;
import org.jboss.metatype.api.values.EnumValue;
+import org.jboss.metatype.api.values.EnumValueSupport;
import org.jboss.metatype.api.values.MapCompositeValueSupport;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.PropertiesMetaValue;
@@ -165,6 +167,10 @@
}
}
+ public static EnumValue wrap(EnumMetaType type, String value) {
+ return new EnumValueSupport(type, value);
+ }
+
public static SimpleValue wrap(MetaType type, String value) {
if (type instanceof SimpleMetaType) {
SimpleMetaType st = (SimpleMetaType)type;
Modified:
branches/7.1.x/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
===================================================================
---
branches/7.1.x/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-11-09
22:45:31 UTC (rev 2717)
+++
branches/7.1.x/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-11-11
19:56:29 UTC (rev 2718)
@@ -28,6 +28,7 @@
import org.teiid.adminapi.Transaction;
import org.teiid.adminapi.Translator;
import org.teiid.adminapi.VDB;
+import org.teiid.adminapi.VDB.ConnectionType;
import org.teiid.core.util.UnitTestUtil;
@Ignore
@@ -42,7 +43,7 @@
//if (!Bootstrap.getInstance().isStarted()) Bootstrap.getInstance().bootstrap();
ds = new ServerDatasourceConnection();
//admin = AdminProvider.getRemote( "jnp://localhost:1099",
"javaduke", "anotherduke");
- admin = AdminFactory.getInstance().createAdmin("admin",
"admin".toCharArray(), "mm://localhost:31443"); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
+ admin = AdminFactory.getInstance().createAdmin("admin",
"admin".toCharArray(), "mms://127.0.0.1:31443"); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
installVDB();
}
@@ -81,6 +82,22 @@
assertNull(admin.getVDB("TransactionsRevisited", 1)); //$NON-NLS-1$
}
+
+ @Test
+ public void testChangeConnectionType() throws Exception {
+ VDB vdb = admin.getVDB("TransactionsRevisited", 1);
+ assertNotNull(vdb); //$NON-NLS-1$
+
+ ConnectionType ct = vdb.getConnectionType();
+ assertEquals(ConnectionType.BY_VERSION, ct);
+
+ admin.changeVDBConnectionType("TransactionsRevisited", 1,
ConnectionType.ANY);
+
+ vdb = admin.getVDB("TransactionsRevisited", 1);
+
+ ct = vdb.getConnectionType();
+ assertEquals(ConnectionType.ANY, ct);
+ }
@Test public void testGetVDB() throws Exception {
VDB vdb = admin.getVDB("TransactionsRevisited", 1);
Modified: branches/7.1.x/test-integration/db/src/test/resources/TransactionsRevisited.vdb
===================================================================
(Binary files differ)
Show replies by date