1 17 package org.apache.geronimo.connector.deployment.jsr88; 18 19 import java.io.ByteArrayInputStream ; 20 import java.io.ByteArrayOutputStream ; 21 import java.io.InputStream ; 22 import java.net.URL ; 23 import java.util.Collections ; 24 import java.util.HashSet ; 25 import java.util.Set ; 26 import javax.enterprise.deploy.model.DDBean ; 27 import javax.enterprise.deploy.model.DDBeanRoot ; 28 import javax.enterprise.deploy.shared.ModuleType ; 29 import javax.enterprise.deploy.spi.DConfigBean ; 30 import junit.framework.TestCase; 31 import org.apache.geronimo.connector.deployment.RARConfiguration; 32 import org.apache.geronimo.deployment.tools.loader.ConnectorDeployable; 33 import org.apache.geronimo.deployment.service.jsr88.EnvironmentData; 34 import org.apache.geronimo.deployment.service.jsr88.Artifact; 35 import org.apache.geronimo.naming.deployment.jsr88.GBeanLocator; 36 import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType; 37 import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument; 38 39 42 public class Connector15DCBTest extends TestCase { 43 private ClassLoader classLoader; 44 45 public void testCreateDatabase() throws Exception { 46 URL resource = classLoader.getResource("database.rar"); 48 assertNotNull(resource); 49 ConnectorDeployable deployable = new ConnectorDeployable(resource); 50 assertEquals(ModuleType.RAR, deployable.getType()); 51 Set entrySet = new HashSet (Collections.list(deployable.entries())); 52 Set resultSet = new HashSet (); 53 resultSet.add("META-INF/"); 54 resultSet.add("META-INF/MANIFEST.MF"); 55 resultSet.add("META-INF/LICENSE.txt"); 56 resultSet.add("META-INF/ra.xml"); 57 resultSet.add("tranql-connector-1.0.jar"); 58 assertEquals(resultSet, entrySet); 59 DDBeanRoot root = deployable.getDDBeanRoot(); 60 assertNotNull(root); 61 assertEquals(ModuleType.RAR, root.getType()); 62 assertEquals(deployable, root.getDeployableObject()); 63 Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root); 65 assertNotNull(dcbRoot.getXpaths()); 66 assertEquals(1, dcbRoot.getXpaths().length); 67 assertEquals("connector", dcbRoot.getXpaths()[0]); 68 ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]); 70 assertNotNull(connector); 71 assertNull(connector.getEnvironment()); 72 EnvironmentData environment = new EnvironmentData(); 73 connector.setEnvironment(environment); 74 Artifact configId = new Artifact(); 75 environment.setConfigId(configId); 76 assertNull(configId.getArtifactId()); 77 assertNull(configId.getGroupId()); 78 assertNull(configId.getType()); 79 assertNull(configId.getVersion()); 80 configId.setGroupId("test"); 81 configId.setArtifactId("product"); 82 configId.setType("rar"); 83 configId.setVersion("1.0"); 84 Artifact parent = new Artifact(); 85 Artifact dependency = new Artifact(); 86 environment.setDependencies(new Artifact[]{parent, dependency}); 87 assertNull(parent.getArtifactId()); 88 assertNull(parent.getGroupId()); 89 assertNull(parent.getType()); 90 assertNull(parent.getVersion()); 91 assertNull(dependency.getArtifactId()); 92 assertNull(dependency.getGroupId()); 93 assertNull(dependency.getType()); 94 assertNull(dependency.getVersion()); 95 parent.setGroupId("org.apache.geronimo.configs"); 96 parent.setArtifactId("j2ee-server"); 97 parent.setType("car"); 98 assertNull(parent.getVersion()); 99 dependency.setGroupId("postgresql"); 100 dependency.setArtifactId("postgresql-8.0"); 101 dependency.setType("jar"); 102 dependency.setVersion("313.jdbc3"); 103 assertNotNull(connector.getResourceAdapter()); 107 assertEquals(1, connector.getResourceAdapter().length); 108 ResourceAdapter adapter = connector.getResourceAdapter()[0]; 109 assertNotNull(adapter); 110 assertNotNull(adapter.getConnectionDefinition()); 112 assertEquals(0, adapter.getConnectionDefinition().length); 113 ConnectionDefinition definition = new ConnectionDefinition(); 114 adapter.setConnectionDefinition(new ConnectionDefinition[]{definition}); 115 assertEquals(1, adapter.getConnectionDefinition().length); 116 definition.setConnectionFactoryInterface("javax.sql.DataSource"); 117 assertNotNull(definition.getConnectionInstances()); 119 assertEquals(0, definition.getConnectionInstances().length); 120 ConnectionDefinitionInstance instance = new ConnectionDefinitionInstance(); 121 definition.setConnectionInstance(new ConnectionDefinitionInstance[]{instance}); 122 assertEquals(1, definition.getConnectionInstances().length); 123 assertNotNull(instance.getDDBean()); 124 assertNotNull(instance.getConfigPropertySetting()); 126 assertEquals(6, instance.getConfigPropertySetting().length); 127 int found = 0; 128 for (int i = 0; i < 6; i++) { 129 ConfigPropertySetting setting = instance.getConfigPropertySetting(i); 130 if(setting.getName().equals("Driver")) { 131 assertNull(setting.getValue()); 132 setting.setValue("org.postgresql.Driver"); 133 ++found; 134 } else if(setting.getName().equals("ConnectionURL")) { 135 assertNull(setting.getValue()); 136 setting.setValue("jdbc:postgresql://localhost/TestDatabase"); 137 ++found; 138 } else if(setting.getName().equals("UserName")) { 139 assertNull(setting.getValue()); 140 setting.setValue("dbuser"); 141 ++found; 142 } else if(setting.getName().equals("Password")) { 143 assertNull(setting.getValue()); 144 setting.setValue("dbpass"); 145 ++found; 146 } else { 147 assertNotNull(setting.getValue()); 148 } 149 } 150 assertEquals(4, found); 151 ConnectionManager manager = instance.getConnectionManager(); 153 assertNotNull(manager); 154 assertFalse(manager.isContainerManagedSecurity()); 155 assertFalse(manager.isPoolNone()); 156 assertNotNull(manager.getPoolSingle()); 157 assertNull(manager.getPoolPartitioned()); 158 assertFalse(manager.isTransactionLog()); 159 assertFalse(manager.isTransactionNone()); 160 assertFalse(manager.isTransactionXA()); 161 assertFalse(manager.isTransactionXACachingThread()); 162 assertFalse(manager.isTransactionXACachingTransaction()); 163 assertTrue(manager.isTransactionLocal()); 164 SinglePool pool = manager.getPoolSingle(); 165 assertNull(pool.getMinSize()); 166 assertNull(pool.getMaxSize()); 167 assertNull(pool.getIdleTimeoutMinutes()); 168 assertNull(pool.getBlockingTimeoutMillis()); 169 assertTrue(pool.isMatchOne()); 170 assertFalse(pool.isMatchAll()); 171 assertFalse(pool.isSelectOneAssumeMatch()); 172 pool.setMinSize(new Integer (2)); 173 pool.setMaxSize(new Integer (30)); 174 pool.setBlockingTimeoutMillis(new Integer (5000)); 175 System.out.println(dcbRoot.getConnectorDocument()); 177 } 178 179 public void testWriteWithNulls() throws Exception { 180 InputStream in = classLoader.getResource("plan-with-nulls.xml").openStream(); 181 182 URL resource = classLoader.getResource("database.rar"); 184 assertNotNull(resource); 185 ConnectorDeployable deployable = new ConnectorDeployable(resource); 186 assertEquals(ModuleType.RAR, deployable.getType()); 187 DDBeanRoot root = deployable.getDDBeanRoot(); 188 assertNotNull(root); 189 assertEquals(ModuleType.RAR, root.getType()); 190 assertEquals(deployable, root.getDeployableObject()); 191 Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root); 193 RARConfiguration configuration = new RARConfiguration(deployable, dcbRoot); 194 configuration.restore(in); 195 ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]); 197 assertNotNull(connector); 198 assertNotNull(connector.getResourceAdapter()); 200 assertEquals(1, connector.getResourceAdapter().length); 201 ResourceAdapter adapter = connector.getResourceAdapter()[0]; 202 assertNotNull(adapter); 203 assertNotNull(adapter.getConnectionDefinition()); 205 assertEquals(1, adapter.getConnectionDefinition().length); 206 ConnectionDefinition definition = adapter.getConnectionDefinition(0); 207 assertNotNull(definition.getConnectionInstances()); 209 assertEquals(1, definition.getConnectionInstances().length); 210 ConnectionDefinitionInstance instance = definition.getConnectionInstances()[0]; 211 assertNotNull(instance.getConfigPropertySetting()); 213 assertEquals(6, instance.getConfigPropertySetting().length); 214 int nullCount = 0; 215 for (int i = 0; i < 6; i++) { 216 if(instance.getConfigPropertySetting(i).getValue() == null) { 217 ++nullCount; 218 } else if(instance.getConfigPropertySetting(i).getValue().equals("")) { 219 instance.getConfigPropertySetting()[i].setValue(null); 220 ++nullCount; 221 } 222 } 223 assertEquals(2, nullCount); 225 ByteArrayOutputStream pout = new ByteArrayOutputStream (); 226 dcbRoot.toXML(pout); 227 pout.close(); 228 ByteArrayInputStream pin = new ByteArrayInputStream (pout.toByteArray()); 229 GerConnectorDocument doc = GerConnectorDocument.Factory.parse(pin); 230 pin.close(); 231 GerConfigPropertySettingType[] settings = doc.getConnector().getResourceadapterArray(0). 232 getOutboundResourceadapter().getConnectionDefinitionArray(0). 233 getConnectiondefinitionInstanceArray(0).getConfigPropertySettingArray(); 234 assertEquals(2, settings.length); 235 Set seen = new HashSet (); 236 for (int i = 0; i < settings.length; i++) { 237 GerConfigPropertySettingType setting = settings[i]; 238 if(seen.contains(setting.getName())) { 239 fail("Duplicate for config property setting '"+setting.getName()+"'"); 240 } 241 seen.add(setting.getName()); 242 if(setting.getName().equals("Driver")) { 248 assertEquals("org.apache.derby.jdbc.EmbeddedDriver", setting.getStringValue()); 249 } else if(setting.getName().equals("ConnectionURL")) { 250 assertEquals("jdbc:derby:TestDatabase;create=true", setting.getStringValue()); 251 } else fail("Unknown connection setting '"+setting.getName()+"'"); 252 } 253 assertEquals(6, instance.getConfigPropertySetting().length); 255 nullCount = 0; 257 for (int i = 0; i < 6; i++) { 258 if(instance.getConfigPropertySetting()[i].getValue() == null || instance.getConfigPropertySetting()[i].isSetToDefault()) { 259 instance.getConfigPropertySetting()[i].setValue(""); 260 ++nullCount; 261 } 262 } 263 assertEquals(4, nullCount); 264 pout = new ByteArrayOutputStream (); 266 dcbRoot.toXML(pout); 267 pout.close(); 268 pin = new ByteArrayInputStream (pout.toByteArray()); 269 doc = GerConnectorDocument.Factory.parse(pin); 270 pin.close(); 271 settings = doc.getConnector().getResourceadapterArray(0). 272 getOutboundResourceadapter().getConnectionDefinitionArray(0). 273 getConnectiondefinitionInstanceArray(0).getConfigPropertySettingArray(); 274 assertEquals(6, settings.length); 275 seen.clear(); 276 for (int i = 0; i < settings.length; i++) { 277 GerConfigPropertySettingType setting = settings[i]; 278 if(seen.contains(setting.getName())) { 279 fail("Duplicate for config property setting '"+setting.getName()+"'"); 280 } 281 seen.add(setting.getName()); 282 if(setting.getName().equals("UserName")) { 283 assertEquals("", setting.getStringValue()); 284 } else if(setting.getName().equals("Password")) { 285 assertEquals("", setting.getStringValue()); 286 } else if(setting.getName().equals("CommitBeforeAutocommit")) { 287 assertEquals("", setting.getStringValue()); 288 } else if(setting.getName().equals("Driver")) { 289 assertEquals("org.apache.derby.jdbc.EmbeddedDriver", setting.getStringValue()); 290 } else if(setting.getName().equals("ExceptionSorterClass")) { 291 assertEquals("", setting.getStringValue()); 292 } else if(setting.getName().equals("ConnectionURL")) { 293 assertEquals("jdbc:derby:TestDatabase;create=true", setting.getStringValue()); 294 } else fail("Unknown connection setting '"+setting.getName()+"'"); 295 } 296 } 297 298 public void testCreateJMSResource() throws Exception { 299 URL resource = classLoader.getResource("jms.rar"); 301 assertNotNull(resource); 302 ConnectorDeployable deployable = new ConnectorDeployable(resource); 303 assertEquals(ModuleType.RAR, deployable.getType()); 304 Set entrySet = new HashSet (Collections.list(deployable.entries())); 305 assertTrue(entrySet.contains("META-INF/ra.xml")); 306 assertTrue(entrySet.contains("activemq-ra-3.2.1.jar")); 307 DDBeanRoot root = deployable.getDDBeanRoot(); 308 assertNotNull(root); 309 assertEquals(ModuleType.RAR, root.getType()); 310 assertEquals(deployable, root.getDeployableObject()); 311 Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root); 313 assertNotNull(dcbRoot.getXpaths()); 314 assertEquals(1, dcbRoot.getXpaths().length); 315 assertEquals("connector", dcbRoot.getXpaths()[0]); 316 ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]); 318 assertNotNull(connector); 319 assertNotNull(connector.getResourceAdapter()); 346 assertEquals(1, connector.getResourceAdapter().length); 347 ResourceAdapter adapter = connector.getResourceAdapter()[0]; 348 assertNotNull(adapter); 349 assertNull(adapter.getResourceAdapterInstance()); 351 adapter.setResourceAdapterInstance(new ResourceAdapterInstance()); 352 ResourceAdapterInstance raInstance = adapter.getResourceAdapterInstance(); 353 assertNull(raInstance.getResourceAdapterName()); 354 assertNotNull(raInstance.getConfigProperties()); 355 assertEquals(7, raInstance.getConfigPropertySetting().length); 356 for (int i = 0; i < raInstance.getConfigPropertySetting().length; i++) { 357 ConfigPropertySetting config = raInstance.getConfigPropertySetting()[i]; 358 assertTrue(config.isSetToDefault()); 359 } 360 int found = 0; 361 for (int i = 0; i < 7; i++) { 362 ConfigPropertySetting setting = raInstance.getConfigPropertySetting(i); 363 if(setting.getName().equals("ServerUrl")) { 364 setting.setValue("tcp://localhost:12345"); 365 ++found; 366 } else if(setting.getName().equals("UserName")) { 367 setting.setValue("test-user"); 368 ++found; 369 } else if(setting.getName().equals("Password")) { 370 setting.setValue("test-password"); 371 ++found; 372 } 373 } 374 assertEquals(found, 3); 375 assertNull(raInstance.getWorkManager()); 377 GBeanLocator workManager = new GBeanLocator(); 378 raInstance.setWorkManager(workManager); 379 workManager.setGBeanLink("DefaultWorkManager"); 380 assertNotNull(adapter.getConnectionDefinition()); 382 assertEquals(0, adapter.getConnectionDefinition().length); 383 ConnectionDefinition definition = new ConnectionDefinition(); 384 adapter.setConnectionDefinition(new ConnectionDefinition[]{definition}); 385 assertEquals(1, adapter.getConnectionDefinition().length); 386 definition.setConnectionFactoryInterface("javax.jms.ConnectionFactory"); 387 assertNotNull(definition.getConnectionInstances()); 389 assertEquals(0, definition.getConnectionInstances().length); 390 ConnectionDefinitionInstance instance = new ConnectionDefinitionInstance(); 391 definition.setConnectionInstance(new ConnectionDefinitionInstance[]{instance}); 392 assertEquals(1, definition.getConnectionInstances().length); 393 assertNotNull(instance.getDDBean()); 394 instance.setName("Test JMS Resource"); 395 instance.setImplementedInterface(new String []{"javax.jms.QueueConnectorFactory","javax.jms.TopicConnectionFactory"}); 396 assertNotNull(instance.getConfigPropertySetting()); 398 assertEquals(0, instance.getConfigPropertySetting().length); 399 ConnectionManager manager = instance.getConnectionManager(); 401 assertNotNull(manager); 402 assertFalse(manager.isContainerManagedSecurity()); 403 assertFalse(manager.isPoolNone()); 404 assertNotNull(manager.getPoolSingle()); 405 assertNull(manager.getPoolPartitioned()); 406 assertFalse(manager.isTransactionLog()); 407 assertFalse(manager.isTransactionNone()); 408 assertTrue(manager.isTransactionXA()); 409 assertFalse(manager.isTransactionXACachingThread()); 410 assertTrue(manager.isTransactionXACachingTransaction()); 411 assertFalse(manager.isTransactionLocal()); 412 SinglePool pool = manager.getPoolSingle(); 413 assertNull(pool.getMinSize()); 414 assertNull(pool.getMaxSize()); 415 assertNull(pool.getIdleTimeoutMinutes()); 416 assertNull(pool.getBlockingTimeoutMillis()); 417 assertTrue(pool.isMatchOne()); 418 assertFalse(pool.isMatchAll()); 419 assertFalse(pool.isSelectOneAssumeMatch()); 420 pool.setMinSize(new Integer (2)); 421 pool.setMaxSize(new Integer (30)); 422 pool.setBlockingTimeoutMillis(new Integer (5000)); 423 DDBean [] ddBeans = connector.getDDBean().getChildBean(connector.getXpaths()[0]); 424 assertNotNull(ddBeans); 425 assertEquals(2, ddBeans.length); 426 DConfigBean [] adminDCBs = new DConfigBean [ddBeans.length]; 427 for (int i = 0; i < adminDCBs.length; i++) { 428 adminDCBs[i] = connector.getDConfigBean(ddBeans[i]); 429 AdminObjectDCB dcb = (AdminObjectDCB) adminDCBs[i]; 430 if(dcb.getAdminObjectClass().indexOf("Queue") > -1) { 431 assertEquals(0, dcb.getAdminObjectInstance().length); 432 AdminObjectInstance one = new AdminObjectInstance(); 433 AdminObjectInstance two = new AdminObjectInstance(); 434 dcb.setAdminObjectInstance(new AdminObjectInstance[]{one, two}); 435 one.setMessageDestinationName("TestQueue1"); 436 one.getConfigPropertySetting()[0].setValue("PhysicalName1"); 437 two.setMessageDestinationName("TestQueue2"); 438 two.getConfigPropertySetting()[0].setValue("PhysicalName2"); 439 } else if(dcb.getAdminObjectClass().indexOf("Topic") > -1) { 440 assertEquals(0, dcb.getAdminObjectInstance().length); 441 } else fail("Unknown AdminobjectDCB admin object class '"+dcb.getAdminObjectClass()+"'"); 442 } 443 444 445 } 448 449 public void testLoadJMSResources() throws Exception { 450 InputStream in = classLoader.getResource("jms-plan.xml").openStream(); 451 URL resource = classLoader.getResource("jms.rar"); 453 assertNotNull(resource); 454 ConnectorDeployable deployable = new ConnectorDeployable(resource); 455 assertEquals(ModuleType.RAR, deployable.getType()); 456 Set entrySet = new HashSet (Collections.list(deployable.entries())); 457 assertTrue(entrySet.contains("META-INF/ra.xml")); 458 assertTrue(entrySet.contains("activemq-ra-3.2.1.jar")); 459 DDBeanRoot root = deployable.getDDBeanRoot(); 460 assertNotNull(root); 461 assertEquals(ModuleType.RAR, root.getType()); 462 assertEquals(deployable, root.getDeployableObject()); 463 Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root); 465 RARConfiguration configuration = new RARConfiguration(deployable, dcbRoot); 466 configuration.restore(in); 467 ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]); 469 assertNotNull(connector); 470 assertNotNull(connector.getResourceAdapter()); 472 assertEquals(1, connector.getResourceAdapter().length); 473 ResourceAdapter adapter = connector.getResourceAdapter()[0]; 474 assertNotNull(adapter); 475 ResourceAdapterInstance raInstance = adapter.getResourceAdapterInstance(); 477 assertNotNull(raInstance); 478 assertEquals("Test ActiveMQ RA", raInstance.getResourceAdapterName()); 479 assertEquals(7, raInstance.getConfigPropertySetting().length); 480 int found = 0; 481 Set seen = new HashSet (); 482 for (int i = 0; i < 7; i++) { 483 ConfigPropertySetting setting = raInstance.getConfigPropertySetting(i); 484 if(seen.contains(setting.getName())) { 485 fail("Duplicate for config property setting '"+setting.getName()+"'"); 486 } 487 seen.add(setting.getName()); 488 if(setting.getName().equals("ServerUrl")) { 489 assertEquals("tcp://localhost:61616", setting.getValue()); 490 ++found; 491 } else if(setting.getName().equals("UserName")) { 492 assertEquals("geronimo-user", setting.getValue()); 493 ++found; 494 } else if(setting.getName().equals("Password")) { 495 assertEquals("geronimo-pw", setting.getValue()); 496 ++found; 497 } 498 } 499 assertEquals(3, found); 500 assertNotNull(adapter.getConnectionDefinition()); 503 assertEquals(1, adapter.getConnectionDefinition().length); 504 ConnectionDefinition definition = adapter.getConnectionDefinition(0); 505 assertNotNull(definition.getConnectionInstances()); 507 assertEquals(1, definition.getConnectionInstances().length); 508 ConnectionDefinitionInstance instance = definition.getConnectionInstances()[0]; 509 assertNotNull(instance.getConfigPropertySetting()); 511 assertEquals(0, instance.getConfigPropertySetting().length); 512 DDBean [] ddBeans = connector.getDDBean().getChildBean(connector.getXpaths()[0]); 514 assertNotNull(ddBeans); 515 assertEquals(2, ddBeans.length); 516 DConfigBean [] adminDCBs = new DConfigBean [ddBeans.length]; 517 for (int i = 0; i < adminDCBs.length; i++) { 518 adminDCBs[i] = connector.getDConfigBean(ddBeans[i]); 519 AdminObjectDCB dcb = (AdminObjectDCB) adminDCBs[i]; 520 if(dcb.getAdminObjectClass().indexOf("Queue") > -1) { 521 assertEquals(3, dcb.getAdminObjectInstance().length); 522 assertEquals("TestQueue1Name", dcb.getAdminObjectInstance()[0].getMessageDestinationName()); 523 assertEquals("TestQueue2Name", dcb.getAdminObjectInstance()[1].getMessageDestinationName()); 524 assertEquals("TestQueue3Name", dcb.getAdminObjectInstance()[2].getMessageDestinationName()); 525 } else if(dcb.getAdminObjectClass().indexOf("Topic") > -1) { 526 assertEquals(1, dcb.getAdminObjectInstance().length); 527 assertEquals("TestTopic1Name", dcb.getAdminObjectInstance()[0].getMessageDestinationName()); 528 } else fail("Unknown AdminobjectDCB admin object class '"+dcb.getAdminObjectClass()+"'"); 529 } 530 ByteArrayOutputStream pout = new ByteArrayOutputStream (); 532 dcbRoot.toXML(pout); 533 pout.close(); 534 ByteArrayInputStream pin = new ByteArrayInputStream (pout.toByteArray()); 535 GerConnectorDocument doc = GerConnectorDocument.Factory.parse(pin); 536 pin.close(); 537 GerConfigPropertySettingType[] settings = doc.getConnector().getResourceadapterArray(0). 538 getResourceadapterInstance().getConfigPropertySettingArray(); 539 assertEquals(2, settings.length); 540 seen.clear(); 541 for (int i = 0; i < settings.length; i++) { 542 GerConfigPropertySettingType setting = settings[i]; 543 if(seen.contains(setting.getName())) { 544 fail("Duplicate for config property setting '"+setting.getName()+"'"); 545 } 546 seen.add(setting.getName()); 547 if(setting.getName().equals("UserName")) { 548 assertEquals("geronimo-user", setting.getStringValue()); 549 } else if(setting.getName().equals("Password")) { 550 assertEquals("geronimo-pw", setting.getStringValue()); 551 } else fail("Unknown connection setting '"+setting.getName()+"'"); 552 } 553 } 554 555 protected void setUp() throws Exception { 556 classLoader = Thread.currentThread().getContextClassLoader(); 557 } 558 } 559 | Popular Tags |