Author: thomas.diesler(a)jboss.com
Date: 2010-02-01 05:14:11 -0500 (Mon, 01 Feb 2010)
New Revision: 100204
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/OSGi284TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleA/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleA/OSGi284ActivatorA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleB/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleB/SomePojo.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/bundleA/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/bundleA/MANIFEST.MF
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/bundleB/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/bundleB/MANIFEST.MF
Modified:
projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
Log:
[JBOSGI-284] Investigate version numbering scheme
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2010-02-01
09:36:03 UTC (rev 100203)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2010-02-01
10:14:11 UTC (rev 100204)
@@ -25,6 +25,7 @@
[JBOSGI-161] Cannot use commons logging
[JBOSGI-210] Bundle is only installed but not started in runtime
[JBOSGI-214] Cannot repeatedly register service bound to an interface from the system
classpath
+ [JBOSGI-284] Investigate version numbering scheme
-->
@@ -150,6 +151,18 @@
<!-- jbosgi214 -->
<bnd classpath="${tests.classes.dir}"
output="${tests.output.dir}/test-libs/jbosgi214-bundle.jar"
files="${tests.resources.dir}/jbosgi214/jbosgi214-bundle.bnd" />
+ <!-- jbosgi284 -->
+ <jar jarfile="${tests.output.dir}/test-libs/jbosgi284-bundleA.jar"
manifest="${tests.resources.dir}/jbosgi284/bundleA/MANIFEST.MF">
+ <fileset dir="${tests.classes.dir}">
+ <include name="org/jboss/test/osgi/jbosgi284/bundleA/**" />
+ </fileset>
+ </jar>
+ <jar jarfile="${tests.output.dir}/test-libs/jbosgi284-bundleB.jar"
manifest="${tests.resources.dir}/jbosgi284/bundleB/MANIFEST.MF">
+ <fileset dir="${tests.classes.dir}">
+ <include name="org/jboss/test/osgi/jbosgi284/bundleB/**" />
+ </fileset>
+ </jar>
+
<!-- localization -->
<bnd classpath="${tests.classes.dir}"
output="${tests.output.dir}/test-libs/localization-simple-host.jar"
files="${tests.resources.dir}/localization/localization-simple-host.bnd" />
<bnd classpath="${tests.classes.dir}"
output="${tests.output.dir}/test-libs/localization-simple-frag.jar"
files="${tests.resources.dir}/localization/localization-simple-frag.bnd" />
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/OSGi284TestCase.java
===================================================================
---
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/OSGi284TestCase.java
(rev 0)
+++
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/OSGi284TestCase.java 2010-02-01
10:14:11 UTC (rev 100204)
@@ -0,0 +1,127 @@
+/*
+ * 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.jbosgi284;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.testing.OSGiTest;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Version;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * [JBOSGI-284] Investigate version numbering scheme
+ *
+ *
https://jira.jboss.org/jira/browse/JBOSGI-284
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 01-Feb-2010
+ */
+public class OSGi284TestCase extends OSGiTest
+{
+ @Test
+ public void testVersionParser() throws Exception
+ {
+ Version dotAlpha = Version.parseVersion("1.0.0.Alpha");
+ assertEquals("1.0.0.Alpha", dotAlpha.toString());
+
+ Version dotBeta = Version.parseVersion("1.0.0.Beta");
+ assertEquals("1.0.0.Beta", dotBeta.toString());
+
+ try
+ {
+ Version.parseVersion("1.0.0-Alpha");
+ fail("NumberFormatException expected");
+ }
+ catch (NumberFormatException ex)
+ {
+ // expected
+ }
+ }
+
+ @Test
+ public void testInstallInvalidBundleVersion() throws Exception
+ {
+ OSGiBootstrapProvider provider = OSGiBootstrap.getBootstrapProvider();
+ Framework framework = provider.getFramework();
+ try
+ {
+ framework.start();
+
+ BundleContext context = framework.getBundleContext();
+ try
+ {
+ // Bundle-SymbolicName: jbosgi284-bundleA
+ // Bundle-Version: 1.0.0-Alpha
+ // Bundle-Activator: org.jboss.test.osgi.jbosgi284.bundleA.OSGi284ActivatorA
+ // Import-Package: org.osgi.framework
+
context.installBundle(getTestArchiveURL("jbosgi284-bundleA.jar").toExternalForm());
+ fail("BundleException expected");
+ }
+ catch (BundleException ex)
+ {
+ // expected
+ }
+ }
+ finally
+ {
+ framework.stop();
+ framework.waitForStop(5000);
+ }
+ }
+
+ @Test
+ public void testExportInvalidPackageVersion() throws Exception
+ {
+ OSGiBootstrapProvider provider = OSGiBootstrap.getBootstrapProvider();
+ Framework framework = provider.getFramework();
+ try
+ {
+ framework.start();
+
+ BundleContext context = framework.getBundleContext();
+ try
+ {
+ // Bundle-SymbolicName: jbosgi284-bundleB
+ // Export-Package:
org.jboss.test.osgi.jbosgi284.bundleB;version="1.0.0-Alpha1"
+
context.installBundle(getTestArchiveURL("jbosgi284-bundleB.jar").toExternalForm());
+ fail("BundleException expected");
+ }
+ catch (BundleException ex)
+ {
+ // expected
+ }
+ }
+ finally
+ {
+ framework.stop();
+ framework.waitForStop(5000);
+ }
+ }
+}
\ No newline at end of file
Property changes on:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/OSGi284TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleA/OSGi284ActivatorA.java
===================================================================
---
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleA/OSGi284ActivatorA.java
(rev 0)
+++
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleA/OSGi284ActivatorA.java 2010-02-01
10:14:11 UTC (rev 100204)
@@ -0,0 +1,38 @@
+/*
+ * 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.jbosgi284.bundleA;
+
+//$Id$
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class OSGi284ActivatorA implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Property changes on:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleA/OSGi284ActivatorA.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleB/SomePojo.java
===================================================================
---
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleB/SomePojo.java
(rev 0)
+++
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleB/SomePojo.java 2010-02-01
10:14:11 UTC (rev 100204)
@@ -0,0 +1,29 @@
+/*
+ * 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.jbosgi284.bundleB;
+
+
+//$Id$
+
+public class SomePojo
+{
+}
Property changes on:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/bundleB/SomePojo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/bundleA/MANIFEST.MF
===================================================================
---
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/bundleA/MANIFEST.MF
(rev 0)
+++
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/bundleA/MANIFEST.MF 2010-02-01
10:14:11 UTC (rev 100204)
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: jbosgi284-bundleA
+Bundle-Version: 1.0.0-Alpha
+Bundle-Activator: org.jboss.test.osgi.jbosgi284.bundleA.OSGi284ActivatorA
+Private-Package: org.jboss.test.osgi.jbosgi284.bundleA
+Import-Package: org.osgi.framework
+
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/bundleB/MANIFEST.MF
===================================================================
---
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/bundleB/MANIFEST.MF
(rev 0)
+++
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi284/bundleB/MANIFEST.MF 2010-02-01
10:14:11 UTC (rev 100204)
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: jbosgi284-bundleB
+Export-Package: org.jboss.test.osgi.jbosgi284.bundleB;version="1.0.0-Alpha1"
+