[jboss-osgi-commits] JBoss-OSGI SVN: r91348 - in projects/jboss-osgi/trunk/reactor/bundles/blueprint: testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser and 8 other directories.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Thu Jul 16 11:54:24 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-07-16 11:54:22 -0400 (Thu, 16 Jul 2009)
New Revision: 91348
Added:
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/bean/
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/bean/BeansBasicParserTestCase.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/root/
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/root/RootElementParserTestCase.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/service/
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/service/ServiceBasicParserTestCase.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/bean/
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/bean/blueprint-beans-basic.xml
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/root/
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/root/blueprint-root-basic.xml
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/root/blueprint-root-defaults.xml
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/service/
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/service/blueprint-basic-service.xml
Removed:
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml
Modified:
projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProp.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/BeanA.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/BeanB.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/ServiceA.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/ServiceB.java
projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
Log:
Add BP required attribute constraints
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProp.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProp.java 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProp.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -58,7 +58,7 @@
this.content = value;
}
- @XmlAttribute
+ @XmlAttribute(required = true)
public String getKey()
{
return key;
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -29,24 +29,14 @@
import org.jboss.osgi.blueprint.BlueprintContext;
/**
- * A property that will be injected into a created <bean>
- * component. The <property> elements correspond to named
- * JavaBean setting methods for a created bean object.
+ * A property that will be injected into a created <bean> component. The <property> elements correspond to named JavaBean setting methods for a created bean object.
*
- * The value and ref attributes are convenience shortcuts to make
- * the <argument> tag easier to code. A fuller set of injected
- * values and types can be specified using one of the "value"
- * type elements.
+ * The value and ref attributes are convenience shortcuts to make the <argument> tag easier to code. A fuller set of injected values and types can be specified using
+ * one of the "value" type elements.
*
- * <xsd:complexType name="Tproperty">
- * <xsd:sequence>
- * <xsd:element name="description" type="Tdescription" minOccurs="0" />
- * <xsd:group ref="Gvalue" minOccurs="0" />
- * </xsd:sequence>
- * <xsd:attribute name="name" type="Tmethod" use="required" />
- * <xsd:attribute name="ref" type="Tidref" />
- * <xsd:attribute name="value" type="TstringValue" />
- * </xsd:complexType>
+ * <xsd:complexType name="Tproperty"> <xsd:sequence> <xsd:element name="description" type="Tdescription" minOccurs="0" /> <xsd:group ref="Gvalue" minOccurs="0" />
+ * </xsd:sequence> <xsd:attribute name="name" type="Tmethod" use="required" /> <xsd:attribute name="ref" type="Tidref" /> <xsd:attribute name="value"
+ * type="TstringValue" /> </xsd:complexType>
*
* @author thomas.diesler at jboss.com
* @since 13-May-2009
@@ -69,7 +59,7 @@
this.description = value;
}
- @XmlAttribute
+ @XmlAttribute(required = true)
public String getName()
{
return name;
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -44,7 +44,7 @@
{
protected String componentId;
- @XmlAttribute
+ @XmlAttribute(required = true)
public String getComponentId()
{
return componentId;
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -50,7 +50,7 @@
protected String key;
protected String value;
- @XmlAttribute
+ @XmlAttribute(required = true)
public String getKey()
{
return key;
Deleted: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint.parser;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.parser.xb.TBean;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.osgi.blueprint.parser.xb.TComponent;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.test.osgi.blueprint.MockBlueprintContext;
-import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
-import org.jboss.test.osgi.blueprint.parser.comp.BeanB;
-import org.junit.Test;
-
-/**
- * Blueprint parser tests
- *
- * @author thomas.diesler at jboss.com
- * @since 13-May-2009
- */
-public class BasicBeansParserTestCase extends OSGiTest
-{
- @Test
- public void testBasicBeans() throws Exception
- {
- URL xmlURL = getResourceURL("parser/blueprint-basic-beans.xml");
- TBlueprint blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
-
- List<TComponent> compList = blueprint.getComponents();
- assertTrue(compList.size() > 0);
-
- TBean beanA = (TBean)compList.get(0);
- assertEquals(BeanA.class.getName(), beanA.getClassName());
- assertEquals("beanA", beanA.getId());
- assertEquals("BeanA Description", beanA.getDescription());
-
- TBean beanB = (TBean)compList.get(1);
- assertEquals(BeanB.class.getName(), beanB.getClassName());
- assertEquals("beanB", beanB.getId());
- assertEquals("BeanB Description", beanB.getDescription());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint.parser;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-
-import java.math.BigInteger;
-import java.net.URL;
-
-import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.parser.xb.TActivation;
-import org.jboss.osgi.blueprint.parser.xb.TAvailability;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.test.osgi.blueprint.MockBlueprintContext;
-import org.junit.Test;
-
-/**
- * Blueprint parser tests
- *
- * @author thomas.diesler at jboss.com
- * @since 13-May-2009
- */
-public class BasicRootParserTestCase extends OSGiTest
-{
- @Test
- public void testBlueprintDefaultAttributes() throws Exception
- {
- URL xmlURL = getResourceURL("parser/blueprint-basic-root.xml");
- TBlueprint blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
-
- // assert default attributes
- assertEquals("default-availability: mandatory", TAvailability.mandatory, blueprint.getDefaultAvailability());
- assertEquals("default-timeout: 300000", new BigInteger("300000"), blueprint.getDefaultTimeout());
- assertEquals("default-activation: eager", TActivation.eager, blueprint.getDefaultActivation());
- }
-
- @Test
- public void testBlueprintDescription() throws Exception
- {
- URL xmlURL = getResourceURL("parser/blueprint-basic-root.xml");
- TBlueprint blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
-
- // assert description
- assertEquals("some text", blueprint.getDescription());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint.parser;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.parser.xb.TBean;
-import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
-import org.jboss.osgi.blueprint.parser.xb.TComponent;
-import org.jboss.osgi.blueprint.parser.xb.TService;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.test.osgi.blueprint.MockBlueprintContext;
-import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
-import org.jboss.test.osgi.blueprint.parser.comp.ServiceA;
-import org.jboss.test.osgi.blueprint.parser.comp.ServiceB;
-import org.junit.Test;
-
-/**
- * Blueprint parser tests
- *
- * @author thomas.diesler at jboss.com
- * @since 13-May-2009
- */
-public class BasicServiceParserTestCase extends OSGiTest
-{
- @Test
- public void testBasicService() throws Exception
- {
- URL xmlURL = getResourceURL("parser/blueprint-basic-service.xml");
- TBlueprint blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
-
- List<TComponent> compList = blueprint.getComponents();
- assertTrue(compList.size() > 0);
-
- TBean beanA = (TBean)compList.get(0);
- assertEquals(BeanA.class.getName(), beanA.getClassName());
- assertEquals("beanA", beanA.getId());
-
- TService serviceA = (TService)compList.get(1);
- assertEquals("serviceA", serviceA.getId());
-
- List<String> intfsA = serviceA.getInterfaces().getValues();
- assertTrue(intfsA.size() > 0);
- assertEquals(ServiceA.class.getName(), intfsA.get(0));
-
- TService serviceB = (TService)compList.get(2);
- assertEquals("serviceB", serviceB.getId());
-
- List<String> intfsB = serviceB.getInterfaces().getValues();
- assertTrue(intfsB.size() > 0);
- assertEquals(ServiceB.class.getName(), intfsB.get(0));
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/bean/BeansBasicParserTestCase.java (from rev 91345, projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/bean/BeansBasicParserTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/bean/BeansBasicParserTestCase.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.blueprint.parser.bean;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.osgi.blueprint.parser.BlueprintParser;
+import org.jboss.osgi.blueprint.parser.xb.TBean;
+import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
+import org.jboss.osgi.blueprint.parser.xb.TComponent;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.test.osgi.blueprint.MockBlueprintContext;
+import org.jboss.test.osgi.blueprint.parser.common.BeanA;
+import org.jboss.test.osgi.blueprint.parser.common.BeanB;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Blueprint parser tests
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 13-May-2009
+ */
+public class BeansBasicParserTestCase
+{
+ static TBlueprint blueprint;
+
+ @BeforeClass
+ public static void beforeClass()
+ {
+ URL xmlURL = new OSGiTestHelper().getResourceURL("parser/bean/blueprint-beans-basic.xml");
+ blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
+ }
+
+ @Test
+ public void testBasicBeans() throws Exception
+ {
+ List<TComponent> compList = blueprint.getComponents();
+ assertTrue(compList.size() > 0);
+
+ TBean beanA = (TBean)compList.get(0);
+ assertEquals(BeanA.class.getName(), beanA.getClassName());
+ assertEquals("beanA", beanA.getId());
+ assertEquals("BeanA Description", beanA.getDescription());
+
+ TBean beanB = (TBean)compList.get(1);
+ assertEquals(BeanB.class.getName(), beanB.getClassName());
+ assertEquals("beanB", beanB.getId());
+ assertEquals("BeanB Description", beanB.getDescription());
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common (from rev 91345, projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp)
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/BeanA.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/BeanA.java 2009-07-16 14:16:10 UTC (rev 91345)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/BeanA.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.blueprint.parser.comp;
+package org.jboss.test.osgi.blueprint.parser.common;
//$Id$
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/BeanB.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/BeanB.java 2009-07-16 14:16:10 UTC (rev 91345)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/BeanB.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.blueprint.parser.comp;
+package org.jboss.test.osgi.blueprint.parser.common;
//$Id$
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/ServiceA.java 2009-07-16 14:16:10 UTC (rev 91345)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/ServiceA.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.blueprint.parser.comp;
+package org.jboss.test.osgi.blueprint.parser.common;
//$Id$
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/ServiceB.java 2009-07-16 14:16:10 UTC (rev 91345)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/common/ServiceB.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.blueprint.parser.comp;
+package org.jboss.test.osgi.blueprint.parser.common;
//$Id$
Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/root/RootElementParserTestCase.java (from rev 91345, projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/root/RootElementParserTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/root/RootElementParserTestCase.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.blueprint.parser.root;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+
+import java.math.BigInteger;
+import java.net.URL;
+
+import org.jboss.osgi.blueprint.parser.BlueprintParser;
+import org.jboss.osgi.blueprint.parser.xb.TActivation;
+import org.jboss.osgi.blueprint.parser.xb.TAvailability;
+import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.test.osgi.blueprint.MockBlueprintContext;
+import org.junit.Test;
+
+/**
+ * Blueprint parser tests
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 13-May-2009
+ */
+public class RootElementParserTestCase
+{
+ @Test
+ public void testBlueprintDefaultAttributes() throws Exception
+ {
+ URL xmlURL = new OSGiTestHelper().getResourceURL("parser/root/blueprint-root-defaults.xml");
+ TBlueprint blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
+
+ // assert default attributes
+ assertEquals("availability", TAvailability.mandatory, blueprint.getDefaultAvailability());
+ assertEquals("timeout", new BigInteger("300000"), blueprint.getDefaultTimeout());
+ assertEquals("activation", TActivation.eager, blueprint.getDefaultActivation());
+ }
+
+ @Test
+ public void testBlueprintDescription() throws Exception
+ {
+ URL xmlURL = new OSGiTestHelper().getResourceURL("parser/root/blueprint-root-basic.xml");
+ TBlueprint blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
+
+ // assert default attributes
+ assertEquals("availability", TAvailability.optional, blueprint.getDefaultAvailability());
+ assertEquals("timeout", new BigInteger("100000"), blueprint.getDefaultTimeout());
+ assertEquals("activation", TActivation.lazy, blueprint.getDefaultActivation());
+
+ // assert description
+ assertEquals("some text", blueprint.getDescription());
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/service/ServiceBasicParserTestCase.java (from rev 91345, projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/service/ServiceBasicParserTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/service/ServiceBasicParserTestCase.java 2009-07-16 15:54:22 UTC (rev 91348)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.blueprint.parser.service;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.osgi.blueprint.parser.BlueprintParser;
+import org.jboss.osgi.blueprint.parser.xb.TBean;
+import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
+import org.jboss.osgi.blueprint.parser.xb.TComponent;
+import org.jboss.osgi.blueprint.parser.xb.TService;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.test.osgi.blueprint.MockBlueprintContext;
+import org.jboss.test.osgi.blueprint.parser.common.BeanA;
+import org.jboss.test.osgi.blueprint.parser.common.ServiceA;
+import org.jboss.test.osgi.blueprint.parser.common.ServiceB;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Blueprint parser tests
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 13-May-2009
+ */
+public class ServiceBasicParserTestCase extends OSGiTest
+{
+ static TBlueprint blueprint;
+
+ @BeforeClass
+ public static void beforeClass()
+ {
+ URL xmlURL = new OSGiTestHelper().getResourceURL("parser/service/blueprint-basic-service.xml");
+ blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
+ }
+
+ @Test
+ public void testBasicService() throws Exception
+ {
+ List<TComponent> compList = blueprint.getComponents();
+ assertTrue(compList.size() > 0);
+
+ TBean beanA = (TBean)compList.get(0);
+ assertEquals(BeanA.class.getName(), beanA.getClassName());
+ assertEquals("beanA", beanA.getId());
+
+ TService serviceA = (TService)compList.get(1);
+ assertEquals("serviceA", serviceA.getId());
+
+ List<String> intfsA = serviceA.getInterfaces().getValues();
+ assertTrue(intfsA.size() > 0);
+ assertEquals(ServiceA.class.getName(), intfsA.get(0));
+
+ TService serviceB = (TService)compList.get(2);
+ assertEquals("serviceB", serviceB.getId());
+
+ List<String> intfsB = serviceB.getInterfaces().getValues();
+ assertTrue(intfsB.size() > 0);
+ assertEquals(ServiceB.class.getName(), intfsB.get(0));
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/bean/blueprint-beans-basic.xml (from rev 91345, projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml)
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/bean/blueprint-beans-basic.xml (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/bean/blueprint-beans-basic.xml 2009-07-16 15:54:22 UTC (rev 91348)
@@ -0,0 +1,13 @@
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="beanA" class="org.jboss.test.osgi.blueprint.parser.common.BeanA">
+ <description>BeanA Description</description>
+ </bean>
+
+ <bean id="beanB" class="org.jboss.test.osgi.blueprint.parser.common.BeanB">
+ <description>BeanB Description</description>
+ <property name="beanA" ref="beanA"/>
+ </bean>
+
+</blueprint>
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-07-16 15:54:22 UTC (rev 91348)
@@ -6,7 +6,7 @@
<type-converters>
<bean>
<reference>
- <ref>
+ <ref component-id="req">
<any>
</type-converters>
<bean id="" activation="" depends-on="" class="" init-method="" destroy-method="" factory-method="" factory-ref="" scope="" any="">
@@ -26,9 +26,27 @@
<map>
<array>
<props>
+ <prop key="req" value="">content</prop>
+ </props>
<null>
</argument>
- <property>
+ <property name="req" ref="" value="">
+ <description>
+ <service>
+ <reference-list>
+ <bean>
+ <reference>
+ <ref>
+ <any>
+ <idref>
+ <value>
+ <list>
+ <set>
+ <map>
+ <array>
+ <props>
+ <null>
+ </property>
<any>
</bean>
<service id="" activation="" depends-on="" interface="" ref="" auto-export="" ranking="" any="">
@@ -37,7 +55,7 @@
<value>
</interfaces>
<service-properties>
- <entry key="" value="">
+ <entry key="req" value="">
<service>
<reference-list>
<bean>
Deleted: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml 2009-07-16 15:54:22 UTC (rev 91348)
@@ -1,13 +0,0 @@
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
-
- <bean id="beanA" class="org.jboss.test.osgi.blueprint.parser.comp.BeanA">
- <description>BeanA Description</description>
- </bean>
-
- <bean id="beanB" class="org.jboss.test.osgi.blueprint.parser.comp.BeanB">
- <description>BeanB Description</description>
- <property name="beanA" ref="beanA"/>
- </bean>
-
-</blueprint>
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml 2009-07-16 15:54:22 UTC (rev 91348)
@@ -1,6 +0,0 @@
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
-
- <description>some text</description>
-
-</blueprint>
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml 2009-07-16 15:46:11 UTC (rev 91347)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml 2009-07-16 15:54:22 UTC (rev 91348)
@@ -1,14 +0,0 @@
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
-
- <bean id="beanA" class="org.jboss.test.osgi.blueprint.parser.comp.BeanA">
- </bean>
-
- <service id="serviceA" ref="beanA" interface="org.jboss.test.osgi.blueprint.parser.comp.ServiceA">
- </service>
-
- <service id="serviceB" interface="org.jboss.test.osgi.blueprint.parser.comp.ServiceB">
- <bean class="org.jboss.test.osgi.blueprint.parser.comp.BeanB"/>
- </service>
-
-</blueprint>
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/root/blueprint-root-basic.xml (from rev 91345, projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml)
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/root/blueprint-root-basic.xml (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/root/blueprint-root-basic.xml 2009-07-16 15:54:22 UTC (rev 91348)
@@ -0,0 +1,7 @@
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"
+ default-activation="lazy" default-availability="optional" default-timeout="100000">
+
+ <description>some text</description>
+
+</blueprint>
\ No newline at end of file
Added: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/root/blueprint-root-defaults.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/root/blueprint-root-defaults.xml (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/root/blueprint-root-defaults.xml 2009-07-16 15:54:22 UTC (rev 91348)
@@ -0,0 +1,4 @@
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+</blueprint>
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/root/blueprint-root-defaults.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/service/blueprint-basic-service.xml (from rev 91345, projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml)
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/service/blueprint-basic-service.xml (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/service/blueprint-basic-service.xml 2009-07-16 15:54:22 UTC (rev 91348)
@@ -0,0 +1,14 @@
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="beanA" class="org.jboss.test.osgi.blueprint.parser.common.BeanA">
+ </bean>
+
+ <service id="serviceA" ref="beanA" interface="org.jboss.test.osgi.blueprint.parser.common.ServiceA">
+ </service>
+
+ <service id="serviceB" interface="org.jboss.test.osgi.blueprint.parser.common.ServiceB">
+ <bean class="org.jboss.test.osgi.blueprint.parser.common.BeanB"/>
+ </service>
+
+</blueprint>
\ No newline at end of file
More information about the jboss-osgi-commits
mailing list