You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Carsten Ziegeler <cz...@apache.org> on 2012/03/21 13:12:32 UTC
Re: svn commit: r1303224 - in /sling/trunk/bundles/commons/classloader:
pom.xml src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
Thanks!
Carsten
2012/3/21 <ju...@apache.org>:
> Author: justin
> Date: Wed Mar 21 00:00:36 2012
> New Revision: 1303224
>
> URL: http://svn.apache.org/viewvc?rev=1303224&view=rev
> Log:
> attempting to fix build failure by using a customized version of the JUnitBundlesOption having the repository URL baked into it. code may require some cleanup, but since I can't reproduce this locally, committing it to see if it fixes the problem before investing too much cleanup time.
>
> Modified:
> sling/trunk/bundles/commons/classloader/pom.xml
> sling/trunk/bundles/commons/classloader/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
>
> Modified: sling/trunk/bundles/commons/classloader/pom.xml
> URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/classloader/pom.xml?rev=1303224&r1=1303223&r2=1303224&view=diff
> ==============================================================================
> --- sling/trunk/bundles/commons/classloader/pom.xml (original)
> +++ sling/trunk/bundles/commons/classloader/pom.xml Wed Mar 21 00:00:36 2012
> @@ -204,24 +204,10 @@
> <scope>test</scope>
> </dependency>
> <dependency>
> - <groupId>org.junit</groupId>
> - <artifactId>com.springsource.org.junit</artifactId>
> - <version>4.9.0</version>
> - <scope>test</scope>
> - </dependency>
> - <dependency>
> <groupId>org.apache.felix</groupId>
> <artifactId>org.apache.felix.framework</artifactId>
> <version>4.0.2</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> - <repositories>
> - <!-- springsource junit wrapping -->
> - <repository>
> - <id>com.springsource.repository.bundles.external</id>
> - <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
> - <url>http://repository.springsource.com/maven/bundles/external</url>
> - </repository>
> - </repositories>
> </project>
>
> Modified: sling/trunk/bundles/commons/classloader/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
> URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/classloader/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java?rev=1303224&r1=1303223&r2=1303224&view=diff
> ==============================================================================
> --- sling/trunk/bundles/commons/classloader/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java (original)
> +++ sling/trunk/bundles/commons/classloader/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java Wed Mar 21 00:00:36 2012
> @@ -19,10 +19,8 @@ package org.apache.sling.commons.classlo
> import static org.junit.Assert.assertEquals;
> import static org.junit.Assert.assertNotNull;
> import static org.junit.Assert.fail;
> -import static org.ops4j.pax.exam.CoreOptions.junitBundles;
> -import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
> -import static org.ops4j.pax.exam.CoreOptions.options;
> -import static org.ops4j.pax.exam.CoreOptions.provision;
> +import static org.ops4j.pax.exam.Constants.*;
> +import static org.ops4j.pax.exam.CoreOptions.*;
>
> import java.io.File;
> import java.io.IOException;
> @@ -40,6 +38,10 @@ import org.ops4j.pax.exam.TestProbeBuild
> import org.ops4j.pax.exam.junit.Configuration;
> import org.ops4j.pax.exam.junit.JUnit4TestRunner;
> import org.ops4j.pax.exam.junit.ProbeBuilder;
> +import org.ops4j.pax.exam.options.AbstractDelegateProvisionOption;
> +import org.ops4j.pax.exam.options.CompositeOption;
> +import org.ops4j.pax.exam.options.DefaultCompositeOption;
> +import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
> import org.osgi.framework.Bundle;
> import org.osgi.framework.BundleContext;
> import org.osgi.framework.Constants;
> @@ -110,10 +112,63 @@ public class DynamicClassLoaderIT {
> mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.2.14"),
> mavenBundle("org.ops4j.pax.url", "pax-url-mvn", "1.3.5")
> ),
> - junitBundles()
> + customJunitBundles()
>
> );
> }
> +
> + private static CompositeOption customJunitBundles() {
> + return new DefaultCompositeOption(new JUnitBundlesOption(),
> + systemProperty( "pax.exam.invoker" ).value( "junit" ),
> + bundle( "link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link" ));
> + }
> +
> + public static class JUnitBundlesOption
> + extends AbstractDelegateProvisionOption<JUnitBundlesOption> {
> +
> + /**
> + * Constructor.
> + */
> + public JUnitBundlesOption(){
> + super(
> + bundle("mvn:http://repository.springsource.com/maven/bundles/external!org.junit/com.springsource.org.junit/4.9.0")
> + );
> + noUpdate();
> + startLevel( START_LEVEL_SYSTEM_BUNDLES );
> + }
> +
> + /**
> + * Sets the junit version.
> + *
> + * @param version junit version.
> + *
> + * @return itself, for fluent api usage
> + */
> + public JUnitBundlesOption version( final String version ) {
> + ( (MavenArtifactProvisionOption) getDelegate() ).version( version );
> + return this;
> + }
> +
> + /**
> + * {@inheritDoc}
> + */
> + @Override
> + public String toString() {
> + final StringBuilder sb = new StringBuilder();
> + sb.append( "JUnitBundlesOption" );
> + sb.append( "{url=" ).append( getURL() );
> + sb.append( '}' );
> + return sb.toString();
> + }
> +
> + /**
> + * {@inheritDoc}
> + */
> + protected JUnitBundlesOption itself() {
> + return this;
> + }
> +
> + }
>
> @Test
> public void testPackageAdminClassLoader() throws Exception {
>
>
--
Carsten Ziegeler
cziegeler@apache.org
Re: svn commit: r1303224 - in /sling/trunk/bundles/commons/classloader:
pom.xml src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
Posted by Justin Edelson <ju...@justinedelson.com>.
np, but it looks like it didn't actually work. I have another idea which
I'll test out shortly.
Be nice if anyone could reproduce this locally :)
On Wed, Mar 21, 2012 at 8:12 AM, Carsten Ziegeler <cz...@apache.org>wrote:
> Thanks!
>
>
> Carsten
>
> 2012/3/21 <ju...@apache.org>:
> > Author: justin
> > Date: Wed Mar 21 00:00:36 2012
> > New Revision: 1303224
> >
> > URL: http://svn.apache.org/viewvc?rev=1303224&view=rev
> > Log:
> > attempting to fix build failure by using a customized version of the
> JUnitBundlesOption having the repository URL baked into it. code may
> require some cleanup, but since I can't reproduce this locally, committing
> it to see if it fixes the problem before investing too much cleanup time.
> >
> > Modified:
> > sling/trunk/bundles/commons/classloader/pom.xml
> >
> sling/trunk/bundles/commons/classloader/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
> >
> > Modified: sling/trunk/bundles/commons/classloader/pom.xml
> > URL:
> http://svn.apache.org/viewvc/sling/trunk/bundles/commons/classloader/pom.xml?rev=1303224&r1=1303223&r2=1303224&view=diff
> >
> ==============================================================================
> > --- sling/trunk/bundles/commons/classloader/pom.xml (original)
> > +++ sling/trunk/bundles/commons/classloader/pom.xml Wed Mar 21 00:00:36
> 2012
> > @@ -204,24 +204,10 @@
> > <scope>test</scope>
> > </dependency>
> > <dependency>
> > - <groupId>org.junit</groupId>
> > - <artifactId>com.springsource.org.junit</artifactId>
> > - <version>4.9.0</version>
> > - <scope>test</scope>
> > - </dependency>
> > - <dependency>
> > <groupId>org.apache.felix</groupId>
> > <artifactId>org.apache.felix.framework</artifactId>
> > <version>4.0.2</version>
> > <scope>test</scope>
> > </dependency>
> > </dependencies>
> > - <repositories>
> > - <!-- springsource junit wrapping -->
> > - <repository>
> > - <id>com.springsource.repository.bundles.external</id>
> > - <name>SpringSource Enterprise Bundle Repository - External
> Bundle Releases</name>
> > - <url>
> http://repository.springsource.com/maven/bundles/external</url>
> > - </repository>
> > - </repositories>
> > </project>
> >
> > Modified:
> sling/trunk/bundles/commons/classloader/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
> > URL:
> http://svn.apache.org/viewvc/sling/trunk/bundles/commons/classloader/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java?rev=1303224&r1=1303223&r2=1303224&view=diff
> >
> ==============================================================================
> > ---
> sling/trunk/bundles/commons/classloader/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
> (original)
> > +++
> sling/trunk/bundles/commons/classloader/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
> Wed Mar 21 00:00:36 2012
> > @@ -19,10 +19,8 @@ package org.apache.sling.commons.classlo
> > import static org.junit.Assert.assertEquals;
> > import static org.junit.Assert.assertNotNull;
> > import static org.junit.Assert.fail;
> > -import static org.ops4j.pax.exam.CoreOptions.junitBundles;
> > -import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
> > -import static org.ops4j.pax.exam.CoreOptions.options;
> > -import static org.ops4j.pax.exam.CoreOptions.provision;
> > +import static org.ops4j.pax.exam.Constants.*;
> > +import static org.ops4j.pax.exam.CoreOptions.*;
> >
> > import java.io.File;
> > import java.io.IOException;
> > @@ -40,6 +38,10 @@ import org.ops4j.pax.exam.TestProbeBuild
> > import org.ops4j.pax.exam.junit.Configuration;
> > import org.ops4j.pax.exam.junit.JUnit4TestRunner;
> > import org.ops4j.pax.exam.junit.ProbeBuilder;
> > +import org.ops4j.pax.exam.options.AbstractDelegateProvisionOption;
> > +import org.ops4j.pax.exam.options.CompositeOption;
> > +import org.ops4j.pax.exam.options.DefaultCompositeOption;
> > +import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
> > import org.osgi.framework.Bundle;
> > import org.osgi.framework.BundleContext;
> > import org.osgi.framework.Constants;
> > @@ -110,10 +112,63 @@ public class DynamicClassLoaderIT {
> > mavenBundle("org.apache.felix",
> "org.apache.felix.eventadmin", "1.2.14"),
> > mavenBundle("org.ops4j.pax.url", "pax-url-mvn", "1.3.5")
> > ),
> > - junitBundles()
> > + customJunitBundles()
> >
> > );
> > }
> > +
> > + private static CompositeOption customJunitBundles() {
> > + return new DefaultCompositeOption(new JUnitBundlesOption(),
> > + systemProperty( "pax.exam.invoker" ).value( "junit" ),
> > + bundle(
> "link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link" ));
> > + }
> > +
> > + public static class JUnitBundlesOption
> > + extends AbstractDelegateProvisionOption<JUnitBundlesOption> {
> > +
> > + /**
> > + * Constructor.
> > + */
> > + public JUnitBundlesOption(){
> > + super(
> > + bundle("mvn:
> http://repository.springsource.com/maven/bundles/external!org.junit/com.springsource.org.junit/4.9.0
> ")
> > + );
> > + noUpdate();
> > + startLevel( START_LEVEL_SYSTEM_BUNDLES );
> > + }
> > +
> > + /**
> > + * Sets the junit version.
> > + *
> > + * @param version junit version.
> > + *
> > + * @return itself, for fluent api usage
> > + */
> > + public JUnitBundlesOption version( final String version ) {
> > + ( (MavenArtifactProvisionOption) getDelegate() ).version(
> version );
> > + return this;
> > + }
> > +
> > + /**
> > + * {@inheritDoc}
> > + */
> > + @Override
> > + public String toString() {
> > + final StringBuilder sb = new StringBuilder();
> > + sb.append( "JUnitBundlesOption" );
> > + sb.append( "{url=" ).append( getURL() );
> > + sb.append( '}' );
> > + return sb.toString();
> > + }
> > +
> > + /**
> > + * {@inheritDoc}
> > + */
> > + protected JUnitBundlesOption itself() {
> > + return this;
> > + }
> > +
> > + }
> >
> > @Test
> > public void testPackageAdminClassLoader() throws Exception {
> >
> >
>
>
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
>