incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1140152 - in /sling/trunk/installer/it: pom.xml src/test/java/org/apache/sling/installer/it/InvalidBundlesTest.java
Date Mon, 27 Jun 2011 13:18:56 GMT
Author: bdelacretaz
Date: Mon Jun 27 13:18:56 2011
New Revision: 1140152

URL: http://svn.apache.org/viewvc?rev=1140152&view=rev
Log:
Add test to verify that bundle with invalid version number is ignored

Modified:
    sling/trunk/installer/it/pom.xml
    sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/InvalidBundlesTest.java

Modified: sling/trunk/installer/it/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/installer/it/pom.xml?rev=1140152&r1=1140151&r2=1140152&view=diff
==============================================================================
--- sling/trunk/installer/it/pom.xml (original)
+++ sling/trunk/installer/it/pom.xml Mon Jun 27 13:18:56 2011
@@ -373,6 +373,33 @@
                         </configuration>
                     </execution>
                     <execution>
+                        <id>invalid-version</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks name="Create invalid-version bundle">
+                                <jar destfile="${project.build.directory}/${project.artifactId}-${project.version}-invalid-version.jar">
+                                    <fileset dir="${project.build.directory}/classes">
+                                        <include name="META-INF/**" />
+                                    </fileset>
+                                    <manifest>
+                                        <attribute name="Manifest-Version" value="2" />
+                                        <attribute name="Bundle-Name" value="OSGi controller
test bundle, invalid version number" />
+                                        <attribute name="Bundle-SymbolicName" value="osgi-installer-invalid-version-test"
/>
+                                          <!-- 
+                                              Use -SNAPSHOT to make bundle version number
invalid.
+                                              In real bundles, bnd and similar tools do the
conversion to
+                                              valid version strings.
+                                           -->
+                                        <attribute name="Bundle-Version" value="1.0.0-SNAPSHOT"
/>
+                                    </manifest>
+                                </jar>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                    <execution>
                         <id>create-test-bundles</id>
                         <phase>test-compile</phase>
                         <configuration>

Modified: sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/InvalidBundlesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/InvalidBundlesTest.java?rev=1140152&r1=1140151&r2=1140152&view=diff
==============================================================================
--- sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/InvalidBundlesTest.java
(original)
+++ sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/InvalidBundlesTest.java
Mon Jun 27 13:18:56 2011
@@ -106,6 +106,13 @@ public class InvalidBundlesTest extends 
             installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle("test-classes/invalid-jar.jar")),
null);
             this.assertNoBundleEvents("Invalid archive should be ignored", listener, null);
         }
+        
+        // Invalid version number in bundle must be ignored
+        {
+            final Object listener = this.startObservingBundleEvents();
+            installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME
+ "-invalid-version.jar")), null);
+            this.assertNoBundleEvents("Invalid version number should be ignored", listener,
null);
+        }
 
     	// Make sure controller is not blocked, by testing an upgrade
     	{



Mime
View raw message