ASF Bugzilla – Attachment 32736 Details for
Bug 57857
Provide an OSGi bundle
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
PAX-EXAM Patch
POI-57857.patch (text/plain), 15.22 KB, created by
Bob Paulin
on 2015-05-14 22:10:06 UTC
(
hide
)
Description:
PAX-EXAM Patch
Filename:
MIME Type:
Creator:
Bob Paulin
Created:
2015-05-14 22:10:06 UTC
Size:
15.22 KB
patch
obsolete
>Index: osgi/src/test/java/org/apache/poi/osgi/TestOSGiBundle.java >=================================================================== >--- osgi/src/test/java/org/apache/poi/osgi/TestOSGiBundle.java (revision 1679306) >+++ osgi/src/test/java/org/apache/poi/osgi/TestOSGiBundle.java (working copy) >@@ -1,84 +0,0 @@ >-/* ==================================================================== >- Licensed to the Apache Software Foundation (ASF) under one or more >- contributor license agreements. See the NOTICE file distributed with >- this work for additional information regarding copyright ownership. >- The ASF licenses this file to You under the Apache License, Version 2.0 >- (the "License"); you may not use this file except in compliance with >- the License. You may obtain a copy of the License at >- >- http://www.apache.org/licenses/LICENSE-2.0 >- >- Unless required by applicable law or agreed to in writing, software >- distributed under the License is distributed on an "AS IS" BASIS, >- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >- See the License for the specific language governing permissions and >- limitations under the License. >-==================================================================== */ >- >-package org.apache.poi.osgi; >- >-import static org.junit.Assert.assertEquals; >-import static org.junit.Assert.assertTrue; >-import static org.ops4j.pax.exam.CoreOptions.bundle; >-import static org.ops4j.pax.exam.CoreOptions.junitBundles; >-import static org.ops4j.pax.exam.CoreOptions.options; >- >-import javax.inject.Inject; >-import java.io.ByteArrayInputStream; >-import java.io.ByteArrayOutputStream; >-import java.io.File; >-import java.io.IOException; >-import java.net.URISyntaxException; >- >-import org.apache.poi.hssf.usermodel.HSSFSheet; >-import org.apache.poi.hssf.usermodel.HSSFWorkbook; >- >-import org.junit.Test; >-import org.junit.runner.RunWith; >-import org.ops4j.pax.exam.Configuration; >-import org.ops4j.pax.exam.Option; >-import org.ops4j.pax.exam.junit.PaxExam; >-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; >-import org.ops4j.pax.exam.spi.reactors.PerMethod; >-import org.osgi.framework.Bundle; >-import org.osgi.framework.BundleContext; >-import org.osgi.framework.ServiceReference; >- >-/** >- * Test to ensure that all our main formats can create, write >- * and read back in, when running under OSGi >- */ >-@RunWith(PaxExam.class) >-@ExamReactorStrategy(PerMethod.class) >-public class TestOSGiBundle { >- >- private final File TARGET = new File("target"); >- >- @Inject >- private BundleContext bc; >- >- @Configuration >- public Option[] configuration() throws IOException, URISyntaxException { >- File base = new File(TARGET, "test-bundles"); >- return options( >- junitBundles(), >- bundle(new File(base, "poi-bundle.jar").toURI().toURL().toString())); >- } >- >- @Test >- public void testHSSF() throws Exception { >- HSSFWorkbook wb = new HSSFWorkbook(); >- HSSFSheet s = wb.createSheet("OSGi"); >- s.createRow(0).createCell(0).setCellValue("With OSGi"); >- >- ByteArrayOutputStream baos = new ByteArrayOutputStream(); >- wb.write(baos); >- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); >- >- wb = new HSSFWorkbook(bais); >- assertEquals(1, wb.getNumberOfSheets()); >- >- s = wb.getSheet("OSGi"); >- assertEquals("With OSGi", s.getRow(0).getCell(0).toString()); >- } >-} >Index: osgi/src/test/java/org/apache/test/poi/osgi/BundleIT.java >=================================================================== >--- osgi/src/test/java/org/apache/test/poi/osgi/BundleIT.java (revision 0) >+++ osgi/src/test/java/org/apache/test/poi/osgi/BundleIT.java (working copy) >@@ -0,0 +1,107 @@ >+/* ==================================================================== >+ Licensed to the Apache Software Foundation (ASF) under one or more >+ contributor license agreements. See the NOTICE file distributed with >+ this work for additional information regarding copyright ownership. >+ The ASF licenses this file to You under the Apache License, Version 2.0 >+ (the "License"); you may not use this file except in compliance with >+ the License. You may obtain a copy of the License at >+ >+ http://www.apache.org/licenses/LICENSE-2.0 >+ >+ Unless required by applicable law or agreed to in writing, software >+ distributed under the License is distributed on an "AS IS" BASIS, >+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ See the License for the specific language governing permissions and >+ limitations under the License. >+==================================================================== */ >+ >+package org.apache.test.poi.osgi; >+ >+import static org.junit.Assert.assertEquals; >+import static org.junit.Assert.assertTrue; >+import static org.ops4j.pax.exam.CoreOptions.bundle; >+import static org.ops4j.pax.exam.CoreOptions.junitBundles; >+import static org.ops4j.pax.exam.CoreOptions.options; >+import static org.ops4j.pax.exam.CoreOptions.frameworkProperty; >+import static org.ops4j.pax.exam.CoreOptions.mavenBundle; >+import static org.ops4j.pax.exam.CoreOptions.vmOption; >+ >+import javax.inject.Inject; >+ >+import java.io.ByteArrayInputStream; >+import java.io.ByteArrayOutputStream; >+import java.io.File; >+import java.io.IOException; >+import java.net.URISyntaxException; >+ >+import org.apache.poi.hssf.usermodel.HSSFSheet; >+import org.apache.poi.hssf.usermodel.HSSFWorkbook; >+import org.junit.Test; >+import org.junit.runner.RunWith; >+import org.ops4j.pax.exam.Configuration; >+import org.ops4j.pax.exam.Option; >+import org.ops4j.pax.exam.ProbeBuilder; >+import org.ops4j.pax.exam.TestProbeBuilder; >+import org.ops4j.pax.exam.junit.PaxExam; >+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; >+import org.ops4j.pax.exam.spi.reactors.PerMethod; >+import org.osgi.framework.Bundle; >+import org.osgi.framework.BundleContext; >+import org.osgi.framework.ServiceReference; >+ >+import aQute.bnd.osgi.Constants; >+ >+/** >+ * Test to ensure that all our main formats can create, write >+ * and read back in, when running under OSGi >+ */ >+@RunWith(PaxExam.class) >+@ExamReactorStrategy(PerMethod.class) >+public class BundleIT { >+ >+ private final File TARGET = new File("target"); >+ >+ private static final String POI_VERSION_PROP = "poiVersion"; >+ >+ private static final String PAX_EXAM_VERSION_PROP = "paxExamVersion"; >+ >+ @Inject >+ private BundleContext bc; >+ >+ @Configuration >+ public Option[] configuration() throws IOException, URISyntaxException { >+ final String poiVersion = System.getProperty( POI_VERSION_PROP, "3.12-beta2" ); >+ final String paxExamVersion = System.getProperty( PAX_EXAM_VERSION_PROP, "4.5.0" ); >+ return options( >+ junitBundles(), >+ frameworkProperty("org.osgi.framework.system.packages.extra").value("org.ops4j.pax.exam;version=" + >+ paxExamVersion +",org.ops4j.pax.exam.options;version=" + >+ paxExamVersion + ",org.ops4j.pax.exam.util;version=" + >+ paxExamVersion + ",org.w3c.dom,org.w3c.dom.html,org.w3c.dom.traversal,org.w3c.dom.ranges,org.w3c.dom.views,javax.xml.crypto"), >+ bundle(new File(TARGET, "poi-bundle-" + poiVersion +".jar").toURI().toURL().toString()), >+ mavenBundle("commons-codec", "commons-codec", "1.9"), >+ mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.bcel", "5.2_4"), >+ mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.xalan", "2.7.1_4"), >+ mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.xerces", "2.9.1_4"), >+ mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.xmlresolver", "1.2_5"), >+ mavenBundle("org.apache.santuario", "xmlsec", "2.0.1") >+ ); >+ } >+ >+ @Test >+ public void testHSSF() throws Exception { >+ HSSFWorkbook wb = new HSSFWorkbook(); >+ HSSFSheet s = wb.createSheet("OSGi"); >+ s.createRow(0).createCell(0).setCellValue("With OSGi"); >+ >+ ByteArrayOutputStream baos = new ByteArrayOutputStream(); >+ wb.write(baos); >+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); >+ >+ wb = new HSSFWorkbook(bais); >+ assertEquals(1, wb.getNumberOfSheets()); >+ >+ s = wb.getSheet("OSGi"); >+ assertEquals("With OSGi", s.getRow(0).getCell(0).toString()); >+ } >+} >Index: osgi/pom.xml >=================================================================== >--- osgi/pom.xml (revision 1679306) >+++ osgi/pom.xml (working copy) >@@ -36,7 +36,7 @@ > OSGi bundle that contains Apache POI, and the dependencies. > </description> > <url>http://poi.apache.org/</url> >- <version>${poi.version}</version> >+ <version>3.12-beta2</version> > <!-- > <version>3.12-beta2</version> > <version>@VERSION@</version> >@@ -45,7 +45,8 @@ > <properties> > <maven.compiler.source>1.6</maven.compiler.source> > <maven.compiler.target>1.6</maven.compiler.target> >- <pax.exam.version>4.4.0</pax.exam.version> >+ <pax.exam.version>4.5.0</pax.exam.version> >+ <poi.version>${version}</poi.version> > </properties> > > <dependencies> >@@ -70,6 +71,7 @@ > <groupId>junit</groupId> > <artifactId>junit</artifactId> > <version>4.12</version> >+ <scope>test</scope> > </dependency> > <dependency> > <groupId>org.ops4j.pax.exam</groupId> >@@ -102,6 +104,12 @@ > <scope>test</scope> > </dependency> > <dependency> >+ <groupId>org.slf4j</groupId> >+ <artifactId>slf4j-simple</artifactId> >+ <version>1.7.12</version> >+ <scope>test</scope> >+ </dependency> >+ <dependency> > <groupId>javax.inject</groupId> > <artifactId>javax.inject</artifactId> > <version>1</version> >@@ -118,6 +126,14 @@ > <build> > <plugins> > <plugin> >+ <artifactId>maven-compiler-plugin</artifactId> >+ <version>3.2</version> >+ <configuration> >+ <source>${maven.compiler.source}</source> >+ <target>${maven.compiler.target}</target> >+ </configuration> >+ </plugin> >+ <plugin> > <groupId>org.apache.felix</groupId> > <artifactId>maven-bundle-plugin</artifactId> > <extensions>true</extensions> >@@ -139,36 +155,23 @@ > org.apache.poi.* > </Export-Package> > <Import-Package> >- !org.junit, >- *, >- org.apache.xmlbeans.impl.xpath.saxon;resolution:=optional, >- org.apache.xmlbeans.impl.xquery.saxon;resolution:=optional, >- org.bouncycastle.cert;resolution:=optional, >- org.bouncycastle.cert.ocsp;resolution:=optional, >- org.bouncycastle.cms.bc;resolution:=optional, >- org.bouncycastle.cert.jcajce;resolution:=optional, >- org.bouncycastle.operator;resolution:=optional, >- org.bouncycastle.operator.bc;resolution:=optional, >- org.bouncycastle.tsp;resolution:=optional, >- org.openxmlformats.schemas.officeDocument.x2006.math;resolution:=optional, >- org.openxmlformats.schemas.schemaLibrary.x2006.main;resolution:=optional, >- schemasMicrosoftComOfficePowerpoint;resolution:=optional, >- schemasMicrosoftComOfficeWord;resolution:=optional, >+ com.sun.javadoc;resolution:=optional, >+ com.sun.tools.javadoc;resolution:=optional, >+ junit.framework;resolution:=optional, >+ org.apache.crimson.*;resolution:=optional, >+ org.apache.tools.ant*;resolution:=optional, >+ org.bouncycastle.*;resolution:=optional, >+ org.junit.*;resolution:=optional, >+ org.openxmlformats*;resolution:=optional, >+ repackage;resolution:=optional, >+ schemasMicrosoftCom*;resolution:=optional, >+ * > </Import-Package> > </instructions> > </configuration> > </plugin> >- <plugin> >- <artifactId>maven-compiler-plugin</artifactId> >- <version>3.2</version> >- <configuration> >- <source>${maven.compiler.source}</source> >- <target>${maven.compiler.target}</target> >- </configuration> >- </plugin> > </plugins> > </build> >- > <profiles> > <profile> > <id>java6</id> >@@ -178,24 +181,8 @@ > <build> > <plugins> > <plugin> >- <artifactId>maven-assembly-plugin</artifactId> >- <executions> >- <execution> >- <phase>pre-integration-test</phase> >- <goals> >- <goal>single</goal> >- </goals> >- <configuration> >- <descriptor>test-bundles.xml</descriptor> >- <finalName>test</finalName> >- <attach>false</attach> >- </configuration> >- </execution> >- </executions> >- </plugin> >- <plugin> > <artifactId>maven-failsafe-plugin</artifactId> >- <version>2.10</version> >+ <version>2.18</version> > <executions> > <execution> > <goals> >@@ -206,6 +193,8 @@ > </executions> > <configuration> > <systemPropertyVariables> >+ <poiVersion>${version}</poiVersion> >+ <paxExamVersion>${pax.exam.version}</paxExamVersion> > <org.ops4j.pax.logging.DefaultServiceLog.level> > WARN > </org.ops4j.pax.logging.DefaultServiceLog.level> >Index: osgi/test-bundles.xml >=================================================================== >--- osgi/test-bundles.xml (revision 1679306) >+++ osgi/test-bundles.xml (working copy) >@@ -1,34 +0,0 @@ >-<!-- >- Licensed to the Apache Software Foundation (ASF) under one or more >- contributor license agreements. See the NOTICE file distributed with >- this work for additional information regarding copyright ownership. >- The ASF licenses this file to You under the Apache License, Version 2.0 >- (the "License"); you may not use this file except in compliance with >- the License. You may obtain a copy of the License at >- >- http://www.apache.org/licenses/LICENSE-2.0 >- >- Unless required by applicable law or agreed to in writing, software >- distributed under the License is distributed on an "AS IS" BASIS, >- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >- See the License for the specific language governing permissions and >- limitations under the License. >- --> >-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> >- <id>bundles</id> >- <formats> >- <format>dir</format> >- </formats> >- <includeBaseDirectory>false</includeBaseDirectory> >- <dependencySets> >- <dependencySet> >- <outputDirectory/> >- <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping> >- <includes> >- <include>org.apache.poi:poi-bundle</include> >- </includes> >- </dependencySet> >- </dependencySets> >-</assembly>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 57857
: 32736 |
34336