[jboss-osgi-commits] JBoss-OSGI SVN: r91370 - in projects/jboss-osgi/trunk: distribution/installer and 3 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Fri Jul 17 06:46:21 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-07-17 06:46:20 -0400 (Fri, 17 Jul 2009)
New Revision: 91370

Added:
   projects/jboss-osgi/trunk/distribution/docbook/.settings/org.eclipse.jdt.core.prefs
   projects/jboss-osgi/trunk/distribution/installer/.project
   projects/jboss-osgi/trunk/distribution/installer/.settings/
   projects/jboss-osgi/trunk/distribution/installer/.settings/org.eclipse.jdt.core.prefs
   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/BasicServiceParserTestCase.java
   projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/RootElementParserTestCase.java
   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
   projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-root-defaults.xml
Removed:
   projects/jboss-osgi/trunk/distribution/docbook/.settings/org.maven.ide.eclipse.prefs
   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/root/
   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/resources/parser/bean/
   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/service/
Log:
Restructure BP parser tests

Added: projects/jboss-osgi/trunk/distribution/docbook/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/distribution/docbook/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ projects/jboss-osgi/trunk/distribution/docbook/.settings/org.eclipse.jdt.core.prefs	2009-07-17 10:46:20 UTC (rev 91370)
@@ -0,0 +1,5 @@
+#Fri Jul 17 10:55:42 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5

Deleted: projects/jboss-osgi/trunk/distribution/docbook/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/distribution/docbook/.settings/org.maven.ide.eclipse.prefs	2009-07-17 06:52:51 UTC (rev 91369)
+++ projects/jboss-osgi/trunk/distribution/docbook/.settings/org.maven.ide.eclipse.prefs	2009-07-17 10:46:20 UTC (rev 91370)
@@ -1,9 +0,0 @@
-#Tue May 26 00:30:31 CEST 2009
-activeProfiles=
-eclipse.preferences.version=1
-fullBuildGoals=process-test-resources
-includeModules=false
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-skipCompilerPlugin=true
-version=1

Added: projects/jboss-osgi/trunk/distribution/installer/.project
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/.project	                        (rev 0)
+++ projects/jboss-osgi/trunk/distribution/installer/.project	2009-07-17 10:46:20 UTC (rev 91370)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>jboss-osgi-distribution</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>


Property changes on: projects/jboss-osgi/trunk/distribution/installer/.settings
___________________________________________________________________
Name: svn:ignore
   + org.maven.ide.eclipse.prefs


Added: projects/jboss-osgi/trunk/distribution/installer/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ projects/jboss-osgi/trunk/distribution/installer/.settings/org.eclipse.jdt.core.prefs	2009-07-17 10:46:20 UTC (rev 91370)
@@ -0,0 +1,5 @@
+#Fri Jul 17 10:55:42 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5

Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java (from rev 91369, 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/BasicBeansParserTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java	2009-07-17 10:46:20 UTC (rev 91370)
@@ -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;
+
+//$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 BasicBeansParserTestCase
+{
+   static TBlueprint blueprint;
+   
+   @BeforeClass
+   public static void beforeClass()
+   {
+      URL xmlURL = new OSGiTestHelper().getResourceURL("parser/blueprint-basic-beans.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/BasicServiceParserTestCase.java (from rev 91369, 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/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java	2009-07-17 10:46:20 UTC (rev 91370)
@@ -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;
+
+//$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 BasicServiceParserTestCase extends OSGiTest
+{
+   static TBlueprint blueprint;
+   
+   @BeforeClass
+   public static void beforeClass()
+   {
+      URL xmlURL = new OSGiTestHelper().getResourceURL("parser/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/java/org/jboss/test/osgi/blueprint/parser/RootElementParserTestCase.java (from rev 91369, 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/RootElementParserTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/RootElementParserTestCase.java	2009-07-17 10:46:20 UTC (rev 91370)
@@ -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;
+
+//$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/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/blueprint-basic-root.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/resources/parser/blueprint-basic-beans.xml (from rev 91369, 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/blueprint-basic-beans.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml	2009-07-17 10:46:20 UTC (rev 91370)
@@ -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

Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml (from rev 91369, 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/blueprint-basic-root.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml	2009-07-17 10:46:20 UTC (rev 91370)
@@ -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

Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml (from rev 91369, projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/service/blueprint-basic-service.xml)
===================================================================
--- projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml	2009-07-17 10:46:20 UTC (rev 91370)
@@ -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

Copied: projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-root-defaults.xml (from rev 91369, 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/blueprint-root-defaults.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/reactor/bundles/blueprint/testsuite/src/test/resources/parser/blueprint-root-defaults.xml	2009-07-17 10:46:20 UTC (rev 91370)
@@ -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



More information about the jboss-osgi-commits mailing list