Author: dain Date: Mon Mar 13 18:49:41 2006 New Revision: 385718 URL: http://svn.apache.org/viewcvs?rev=385718&view=rev Log: Fixed all tests in EARConfigBuilderTest Removed unsupported gbeanName element from gbean schema Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java geronimo/branches/1.1/modules/j2ee-builder/src/test-ear/META-INF/geronimo-application.xml geronimo/branches/1.1/modules/j2ee-builder/src/test-ear13/META-INF/geronimo-application.xml geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-car.xml geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-ejb-jar.xml geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-rar.xml geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-war.xml geronimo/branches/1.1/modules/j2ee-builder/src/test-unpacked-ear/META-INF/geronimo-application-alt-dd.xml geronimo/branches/1.1/modules/j2ee-builder/src/test-unpacked-ear/META-INF/geronimo-application.xml geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java geronimo/branches/1.1/modules/service-builder/src/schema/geronimo-config-1.1.xsd Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original) +++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Mon Mar 13 18:49:41 2006 @@ -31,6 +31,7 @@ import org.apache.geronimo.gbean.GBeanInfoBuilder; import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.gbean.AbstractNameQuery; +import org.apache.geronimo.gbean.ReferencePatterns; import org.apache.geronimo.j2ee.ApplicationInfo; import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; import org.apache.geronimo.j2ee.management.impl.J2EEApplicationImpl; @@ -53,6 +54,7 @@ import org.apache.geronimo.xbeans.geronimo.j2ee.GerModuleType; import org.apache.geronimo.xbeans.j2ee.ApplicationType; import org.apache.geronimo.xbeans.j2ee.ModuleType; +import org.apache.geronimo.management.J2EEServer; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlObject; @@ -369,7 +371,7 @@ } catch (Exception e) { throw new DeploymentException("Error initializing J2EEApplication managed object"); } - gbeanData.setReferencePattern("j2eeServer", earContext.getServerName()); + gbeanData.setReferencePatterns("j2eeServer", new ReferencePatterns(new AbstractNameQuery(J2EEServer.class.getName()))); earContext.addGBean(gbeanData); } @@ -392,8 +394,9 @@ earContext.addGBean(jaccBeanData); earContext.setJaccManagerName(jaccBeanData.getAbstractName()); } + ConfigurationData configurationData = earContext.getConfigurationData(); earContext.close(); - return earContext.getConfigurationData(); + return configurationData; } catch (GBeanAlreadyExistsException e) { throw new DeploymentException(e); } finally { Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test-ear/META-INF/geronimo-application.xml URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test-ear/META-INF/geronimo-application.xml?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/j2ee-builder/src/test-ear/META-INF/geronimo-application.xml (original) +++ geronimo/branches/1.1/modules/j2ee-builder/src/test-ear/META-INF/geronimo-application.xml Mon Mar 13 18:49:41 2006 @@ -32,7 +32,7 @@ - Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test-ear13/META-INF/geronimo-application.xml URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test-ear13/META-INF/geronimo-application.xml?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/j2ee-builder/src/test-ear13/META-INF/geronimo-application.xml (original) +++ geronimo/branches/1.1/modules/j2ee-builder/src/test-ear13/META-INF/geronimo-application.xml Mon Mar 13 18:49:41 2006 @@ -35,6 +35,6 @@ - + Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-car.xml URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-car.xml?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-car.xml (original) +++ geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-car.xml Mon Mar 13 18:49:41 2006 @@ -32,6 +32,6 @@ - + Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-ejb-jar.xml URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-ejb-jar.xml?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-ejb-jar.xml (original) +++ geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-ejb-jar.xml Mon Mar 13 18:49:41 2006 @@ -32,6 +32,6 @@ - + Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-rar.xml URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-rar.xml?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-rar.xml (original) +++ geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-rar.xml Mon Mar 13 18:49:41 2006 @@ -32,6 +32,6 @@ - + Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-war.xml URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-war.xml?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-war.xml (original) +++ geronimo/branches/1.1/modules/j2ee-builder/src/test-plan/test-bad-war.xml Mon Mar 13 18:49:41 2006 @@ -32,6 +32,6 @@ - + Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test-unpacked-ear/META-INF/geronimo-application-alt-dd.xml URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test-unpacked-ear/META-INF/geronimo-application-alt-dd.xml?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/j2ee-builder/src/test-unpacked-ear/META-INF/geronimo-application-alt-dd.xml (original) +++ geronimo/branches/1.1/modules/j2ee-builder/src/test-unpacked-ear/META-INF/geronimo-application-alt-dd.xml Mon Mar 13 18:49:41 2006 @@ -48,6 +48,6 @@ - + Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test-unpacked-ear/META-INF/geronimo-application.xml URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test-unpacked-ear/META-INF/geronimo-application.xml?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/j2ee-builder/src/test-unpacked-ear/META-INF/geronimo-application.xml (original) +++ geronimo/branches/1.1/modules/j2ee-builder/src/test-unpacked-ear/META-INF/geronimo-application.xml Mon Mar 13 18:49:41 2006 @@ -35,6 +35,6 @@ - + Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java (original) +++ geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java Mon Mar 13 18:49:41 2006 @@ -42,7 +42,6 @@ import org.apache.geronimo.gbean.GBeanInfo; import org.apache.geronimo.gbean.GBeanInfoBuilder; import org.apache.geronimo.gbean.AbstractNameQuery; -import org.apache.geronimo.gbean.ReferencePatterns; import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; import org.apache.geronimo.kernel.config.Configuration; import org.apache.geronimo.kernel.config.ConfigurationData; @@ -246,44 +245,44 @@ } public void testBuildConfiguration() throws Exception { -// Kernel kernel = KernelFactory.newInstance().createKernel("foo"); -// kernel.boot(); -// -// GBeanData store = new GBeanData(Naming.createChildName(rootConfig, "ConfigStore", "ConfigStore"), MockConfigStore.GBEAN_INFO); -// kernel.loadGBean(store, this.getClass().getClassLoader()); -// kernel.startGBean(store.getAbstractName()); -// -// GBeanData configurationManagerData = new GBeanData(Naming.createChildName(rootConfig, "ConfigurationManager", "ConfigurationManager"), ConfigurationManagerImpl.GBEAN_INFO); -// configurationManagerData.setReferencePattern("Stores", new AbstractNameQuery(store.getAbstractName())); -// kernel.loadGBean(configurationManagerData, getClass().getClassLoader()); -// kernel.startGBean(configurationManagerData.getAbstractName()); -// -// EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, -// new AbstractNameQuery(transactionManagerObjectName), -// new AbstractNameQuery(connectionTrackerObjectName), -// new AbstractNameQuery(transactionalTimerObjectName), -// new AbstractNameQuery(nonTransactionalTimerObjectName), -// null, -// null, -// ejbConfigBuilder, -// ejbConfigBuilder, -// webConfigBuilder, -// connectorConfigBuilder, -// resourceReferenceBuilder, -// appClientConfigBuilder, -// serviceReferenceBuilder, -// kernel); -// -// ConfigurationData configurationData = null; -// try { -// Object plan = configBuilder.getDeploymentPlan(null, earFile); -// configurationData = configBuilder.buildConfiguration(plan, earFile, configStore); -// } finally { -// if (configurationData != null) { -// DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir()); -// } -// kernel.shutdown(); -// } + Kernel kernel = KernelFactory.newInstance().createKernel("foo"); + kernel.boot(); + + GBeanData store = new GBeanData(Naming.createChildName(rootConfig, "ConfigStore", "ConfigStore"), MockConfigStore.GBEAN_INFO); + kernel.loadGBean(store, this.getClass().getClassLoader()); + kernel.startGBean(store.getAbstractName()); + + GBeanData configurationManagerData = new GBeanData(Naming.createChildName(rootConfig, "ConfigurationManager", "ConfigurationManager"), ConfigurationManagerImpl.GBEAN_INFO); + configurationManagerData.setReferencePattern("Stores", new AbstractNameQuery(store.getAbstractName())); + kernel.loadGBean(configurationManagerData, getClass().getClassLoader()); + kernel.startGBean(configurationManagerData.getAbstractName()); + + EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, + new AbstractNameQuery(transactionManagerObjectName), + new AbstractNameQuery(connectionTrackerObjectName), + new AbstractNameQuery(transactionalTimerObjectName), + new AbstractNameQuery(nonTransactionalTimerObjectName), + null, + null, + ejbConfigBuilder, + ejbConfigBuilder, + webConfigBuilder, + connectorConfigBuilder, + resourceReferenceBuilder, + appClientConfigBuilder, + serviceReferenceBuilder, + kernel); + + ConfigurationData configurationData = null; + try { + Object plan = configBuilder.getDeploymentPlan(null, earFile); + configurationData = configBuilder.buildConfiguration(plan, earFile, configStore); + } finally { + if (configurationData != null) { + DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir()); + } + kernel.shutdown(); + } } public void testBadEJBJARConfiguration() throws Exception { @@ -534,7 +533,7 @@ environment.getProperties().put(NameFactory.JSR77_BASE_NAME_PROPERTY, "geronimo.test:J2EEServer=geronimo"); configData.setAttribute("environment", environment); configData.setAttribute("gBeanState", NO_OBJECTS_OS); - configData.setAttribute("type", ConfigurationModuleType.CAR); + configData.setAttribute("moduleType", ConfigurationModuleType.CAR); return configData; } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java Mon Mar 13 18:49:41 2006 @@ -45,7 +45,7 @@ /** * A GBeanInstance is a J2EE Management Managed Object, and is standard base for Geronimo services. * - * @version $Rev$ $Date$ + * @version $Rev: 384351 $ $Date$ */ public final class GBeanInstance implements StateManageable { private static final Log log = LogFactory.getLog(GBeanInstance.class); @@ -640,7 +640,7 @@ if (attribute.isPersistent()) { return attribute.getPersistentValue(); } else { - throw new IllegalStateException("Cannot retrieve the value for non-persistent attribute " + attribute.getName() + " when GBeanInstance is DESTROYED"); + throw new IllegalStateException("Cannot retrieve the value for non-persistent attribute \"" + attribute.getName() + "\" when GBeanInstance is DESTROYED"); } } } @@ -780,7 +780,7 @@ private GBeanAttribute getAttributeByName(String name) throws NoSuchAttributeException { Integer index = (Integer) attributeIndex.get(name); if (index == null) { - throw new NoSuchAttributeException("Unknown attribute " + name + " in gbean " + abstractName.getObjectName()); + throw new NoSuchAttributeException("Unknown attribute \"" + name + "\" in gbean " + abstractName.getObjectName()); } return attributes[index.intValue()]; } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java Mon Mar 13 18:49:41 2006 @@ -645,7 +645,7 @@ static { GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(Configuration.class);//does not use jsr-77 naming infoFactory.addReference("Parents", Configuration.class); - infoFactory.addAttribute("type", ConfigurationModuleType.class, true, false); + infoFactory.addAttribute("moduleType", ConfigurationModuleType.class, true, false); infoFactory.addAttribute("environment", Environment.class, true, false); infoFactory.addAttribute("classPath", List.class, true, false); infoFactory.addAttribute("gBeanState", byte[].class, true, false); @@ -655,7 +655,7 @@ infoFactory.setConstructor(new String[]{ "Parents", - "type", + "moduleType", "environment", "classPath", "gBeanState", Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java Mon Mar 13 18:49:41 2006 @@ -119,7 +119,7 @@ Artifact id = configurationData.getId(); AbstractName abstractName = Configuration.getConfigurationAbstractName(id); GBeanData gbeanData = new GBeanData(abstractName, Configuration.GBEAN_INFO); - gbeanData.setAttribute("type", configurationData.getModuleType()); + gbeanData.setAttribute("moduleType", configurationData.getModuleType()); Environment environment = configurationData.getEnvironment(); gbeanData.setAttribute("environment", environment); gbeanData.setAttribute("gBeanState", Configuration.storeGBeans(configurationData.getGBeans())); Modified: geronimo/branches/1.1/modules/service-builder/src/schema/geronimo-config-1.1.xsd URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/service-builder/src/schema/geronimo-config-1.1.xsd?rev=385718&r1=385717&r2=385718&view=diff ============================================================================== --- geronimo/branches/1.1/modules/service-builder/src/schema/geronimo-config-1.1.xsd (original) +++ geronimo/branches/1.1/modules/service-builder/src/schema/geronimo-config-1.1.xsd Mon Mar 13 18:49:41 2006 @@ -229,9 +229,7 @@ - - - +