You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by tj...@apache.org on 2014/06/30 18:55:06 UTC
svn commit: r1606837 [17/27] - in /aries/branches/subsystemsR6: ./
application/ application/application-api/ application/application-bundle/
application/application-converters/
application/application-default-local-platform/
application/application-dep...
Modified: aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/AsmProxyManager.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/AsmProxyManager.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/AsmProxyManager.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/AsmProxyManager.java Mon Jun 30 16:54:57 2014
@@ -18,13 +18,19 @@
*/
package org.apache.aries.proxy.impl;
+import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Modifier;
import java.lang.reflect.Proxy;
+import java.net.URL;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
import java.util.Set;
import java.util.concurrent.Callable;
@@ -100,13 +106,100 @@ public final class AsmProxyManager exten
}
}
if(proxyObject == null){
- proxyObject = ProxySubclassGenerator.newProxySubclassInstance(classToProxy, new ProxyHandler(this, dispatcher, listener));
+ // ARIES-1216 : in some cases, some class can not be visible from the root class classloader.
+ // If that's the case, we need to build a custom classloader that has visibility on all those classes
+ // If we could generate a proper constructor this would not be necessary, but since we have to rely
+ // on the generated serialization constructor to bypass the JVM verifier, we don't have much choice
+ ClassLoader classLoader = classToProxy.getClassLoader();
+ boolean allVisible = true;
+ for (Class<?> clazz : classes) {
+ try {
+ if (classLoader.loadClass(clazz.getName()) != clazz) {
+ throw new UnableToProxyException(classToProxy, "The requested class " + clazz + " is different from the one seen by by " + classToProxy);
+ }
+ } catch (ClassNotFoundException e) {
+ allVisible = false;
+ break;
+ }
+ }
+ if (!allVisible) {
+ List<ClassLoader> classLoaders = new ArrayList<ClassLoader>();
+ for (Class<?> clazz : classes) {
+ ClassLoader cl = clazz.getClassLoader();
+ if (cl != null && !classLoaders.contains(cl)) {
+ classLoaders.add(cl);
+ }
+ }
+ classLoader = new MultiClassLoader(classLoaders);
+ }
+ proxyObject = ProxySubclassGenerator.newProxySubclassInstance(classToProxy, classLoader, new ProxyHandler(this, dispatcher, listener));
}
}
return proxyObject;
}
+ private static class MultiClassLoader extends ClassLoader {
+ private final List<ClassLoader> parents;
+ private MultiClassLoader(List<ClassLoader> parents) {
+ this.parents = parents;
+ }
+
+ @Override
+ public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ for (ClassLoader cl : parents) {
+ try {
+ return cl.loadClass(name);
+ } catch (ClassNotFoundException e) {
+ // Ignore
+ }
+ }
+ throw new ClassNotFoundException(name);
+ }
+
+ @Override
+ public URL getResource(String name) {
+ for (ClassLoader cl : parents) {
+ URL url = cl.getResource(name);
+ if (url != null) {
+ return url;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Enumeration<URL> getResources(String name) throws IOException {
+ final List<Enumeration<URL>> tmp = new ArrayList<Enumeration<URL>>();
+ for (ClassLoader cl : parents) {
+ tmp.add(cl.getResources(name));
+ }
+ return new Enumeration<URL>() {
+ int index = 0;
+ @Override
+ public boolean hasMoreElements() {
+ return next();
+ }
+ @Override
+ public URL nextElement() {
+ if (!next()) {
+ throw new NoSuchElementException();
+ }
+ return tmp.get(index).nextElement();
+ }
+ private boolean next() {
+ while (index < tmp.size()) {
+ if (tmp.get(index) != null && tmp.get(index).hasMoreElements()) {
+ return true;
+ }
+ index++;
+ }
+ return false;
+ }
+ };
+ }
+ }
+
private Class<?> getLowestSubclass(Set<Class<?>> notInterfaces) throws
UnableToProxyException {
Modified: aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyMethodAdapter.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyMethodAdapter.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyMethodAdapter.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyMethodAdapter.java Mon Jun 30 16:54:57 2014
@@ -29,6 +29,7 @@ import static org.apache.aries.proxy.imp
import static org.apache.aries.proxy.impl.common.AbstractWovenProxyAdapter.WOVEN_PROXY_IFACE_TYPE;
import static org.objectweb.asm.Opcodes.ACONST_NULL;
import static org.objectweb.asm.Opcodes.IFNE;
+import static org.objectweb.asm.Opcodes.ASM4;
import java.util.Arrays;
@@ -161,6 +162,7 @@ public abstract class AbstractWovenProxy
private final Type methodDeclaringType;
private final boolean isMethodDeclaringTypeInterface;
+ private boolean isDefaultMethod;
/**
* Construct a new method adapter
@@ -176,9 +178,9 @@ public abstract class AbstractWovenProxy
*/
public AbstractWovenProxyMethodAdapter(MethodVisitor mv, int access, String name, String desc,
String methodStaticFieldName, Method currentTransformMethod, Type typeBeingWoven,
- Type methodDeclaringType, boolean isMethodDeclaringTypeInterface)
+ Type methodDeclaringType, boolean isMethodDeclaringTypeInterface, boolean isDefaultMethod)
{
- super(mv, access, name, desc);
+ super(ASM4, mv, access, name, desc);
this.methodStaticFieldName = methodStaticFieldName;
this.currentTransformMethod = currentTransformMethod;
returnType = currentTransformMethod.getReturnType();
@@ -186,6 +188,7 @@ public abstract class AbstractWovenProxy
this.typeBeingWoven = typeBeingWoven;
this.methodDeclaringType = methodDeclaringType;
this.isMethodDeclaringTypeInterface = isMethodDeclaringTypeInterface;
+ this.isDefaultMethod = isDefaultMethod;
}
@Override
@@ -223,7 +226,7 @@ public abstract class AbstractWovenProxy
loadLocal(dispatchTarget);
checkCast(methodDeclaringType);
loadArgs();
- if(isMethodDeclaringTypeInterface) {
+ if(isMethodDeclaringTypeInterface && !isDefaultMethod) {
invokeInterface(methodDeclaringType, currentTransformMethod);
} else {
invokeVirtual(methodDeclaringType, currentTransformMethod);
Modified: aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/WovenProxyAbstractMethodAdapter.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/WovenProxyAbstractMethodAdapter.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/WovenProxyAbstractMethodAdapter.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/WovenProxyAbstractMethodAdapter.java Mon Jun 30 16:54:57 2014
@@ -31,9 +31,9 @@ public final class WovenProxyAbstractMet
public WovenProxyAbstractMethodAdapter(MethodVisitor mv, int access, String name,
String desc, String methodStaticFieldName, Method currentTransformMethod,
- Type typeBeingWoven, Type methodDeclaringType, boolean isMethodDeclaringTypeInterface) {
+ Type typeBeingWoven, Type methodDeclaringType, boolean isMethodDeclaringTypeInterface, boolean isDefaultMethod) {
super(mv, access, name, desc, methodStaticFieldName, currentTransformMethod,
- typeBeingWoven, methodDeclaringType, isMethodDeclaringTypeInterface);
+ typeBeingWoven, methodDeclaringType, isMethodDeclaringTypeInterface, isDefaultMethod);
}
/**
Modified: aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/WovenProxyConcreteMethodAdapter.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/WovenProxyConcreteMethodAdapter.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/WovenProxyConcreteMethodAdapter.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/WovenProxyConcreteMethodAdapter.java Mon Jun 30 16:54:57 2014
@@ -34,11 +34,11 @@ public final class WovenProxyConcreteMet
public WovenProxyConcreteMethodAdapter(MethodVisitor mv, int access, String name,
String desc, String[] exceptions, String methodStaticFieldName, Method currentTransformMethod,
- Type typeBeingWoven, Type methodDeclaringType) {
+ Type typeBeingWoven, Type methodDeclaringType, boolean isMethodDeclaringTypeInterface) {
//If we're running on Java 6+ We need to inline any JSR instructions because we're computing stack frames.
//otherwise we can save the overhead
super(mv, access, name, desc, methodStaticFieldName, currentTransformMethod, typeBeingWoven,
- methodDeclaringType, false);
+ methodDeclaringType, isMethodDeclaringTypeInterface, false);
}
/**
Modified: aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassAdapter.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassAdapter.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassAdapter.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassAdapter.java Mon Jun 30 16:54:57 2014
@@ -271,6 +271,10 @@ public class ProxySubclassAdapter extend
// read the current class and use a
// ProxySubclassHierarchyAdapter
// to process only methods on that class that are in the list
+ ClassLoader loader = currentlyAnalysedClass.getClassLoader();
+ if (loader == null) {
+ loader = this.loader;
+ }
ClassReader cr = new ClassReader(loader.getResourceAsStream(currentlyAnalysedClass
.getName().replaceAll("\\.", "/")
+ ".class"));
Modified: aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassGenerator.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassGenerator.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassGenerator.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassGenerator.java Mon Jun 30 16:54:57 2014
@@ -72,9 +72,13 @@ public class ProxySubclassGenerator
public static Class<?> getProxySubclass(Class<?> aClass) throws UnableToProxyException
{
+ return getProxySubclass(aClass, aClass.getClassLoader());
+ }
+
+ public static Class<?> getProxySubclass(Class<?> aClass, ClassLoader loader) throws UnableToProxyException
+ {
LOGGER.debug(Constants.LOG_ENTRY, "getProxySubclass", new Object[] { aClass });
- ClassLoader loader = aClass.getClassLoader();
// in the special case where the loader is null we use a default classloader
// this is for subclassing java.* or javax.* packages, so that one will do
if (loader == null) loader = defaultClassLoader;
@@ -152,13 +156,19 @@ public class ProxySubclassGenerator
public static Object newProxySubclassInstance(Class<?> classToProxy, InvocationHandler ih)
throws UnableToProxyException
{
+ return newProxySubclassInstance(classToProxy, classToProxy.getClassLoader(), ih);
+ }
+
+ public static Object newProxySubclassInstance(Class<?> classToProxy, ClassLoader loader, InvocationHandler ih)
+ throws UnableToProxyException
+ {
LOGGER.debug(Constants.LOG_ENTRY, "newProxySubclassInstance", new Object[] {
- classToProxy, ih });
+ classToProxy, loader, ih });
Object proxySubclassInstance = null;
try {
- Class<?> generatedProxySubclass = getProxySubclass(classToProxy);
+ Class<?> generatedProxySubclass = getProxySubclass(classToProxy, loader);
LOGGER.debug("Getting the proxy subclass constructor");
// Because the newer JVMs throw a VerifyError if a class attempts to in a constructor other than their superclasses constructor,
// and because we can't know what objects/values we need to pass into the class being proxied constructor,
Modified: aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/interfaces/InterfaceUsingWovenProxyAdapter.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/interfaces/InterfaceUsingWovenProxyAdapter.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/interfaces/InterfaceUsingWovenProxyAdapter.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/interfaces/InterfaceUsingWovenProxyAdapter.java Mon Jun 30 16:54:57 2014
@@ -47,17 +47,21 @@ final class InterfaceUsingWovenProxyAdap
String methodStaticFieldName, Type currentMethodDeclaringType,
boolean currentMethodDeclaringTypeIsInterface) {
- if ((access & ACC_ABSTRACT) != 0) {
+ boolean isDefaultMethod = currentMethodDeclaringTypeIsInterface &&
+ ((access & (ACC_ABSTRACT | ACC_PUBLIC | ACC_STATIC)) == ACC_PUBLIC);
+
+
+ if ((access & ACC_ABSTRACT) != 0 || isDefaultMethod) {
access &= ~ACC_ABSTRACT;
return new WovenProxyAbstractMethodAdapter(cv.visitMethod(
access, name, desc, signature, exceptions), access, name, desc,
methodStaticFieldName, currentMethod, typeBeingWoven,
- currentMethodDeclaringType, currentMethodDeclaringTypeIsInterface);
+ currentMethodDeclaringType, currentMethodDeclaringTypeIsInterface, isDefaultMethod);
} else {
return new WovenProxyConcreteMethodAdapter(cv.visitMethod(
access, name, desc, signature, exceptions), access, name, desc, exceptions,
methodStaticFieldName, currentMethod, typeBeingWoven,
- currentMethodDeclaringType);
+ currentMethodDeclaringType, currentMethodDeclaringTypeIsInterface);
}
}
}
Modified: aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/weaving/SyntheticSerialVerUIDAdder.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/weaving/SyntheticSerialVerUIDAdder.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/weaving/SyntheticSerialVerUIDAdder.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/weaving/SyntheticSerialVerUIDAdder.java Mon Jun 30 16:54:57 2014
@@ -20,6 +20,7 @@ package org.apache.aries.proxy.impl.weav
import java.lang.reflect.Modifier;
+import static org.objectweb.asm.Opcodes.ASM4;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
@@ -41,7 +42,7 @@ class SyntheticSerialVerUIDAdder extends
private boolean hasSVUID;
public SyntheticSerialVerUIDAdder(WovenProxyAdapter cv) {
- super(cv);
+ super(ASM4, cv);
wpa = cv;
}
Modified: aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/weaving/WovenProxyAdapter.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/weaving/WovenProxyAdapter.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/weaving/WovenProxyAdapter.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/weaving/WovenProxyAdapter.java Mon Jun 30 16:54:57 2014
@@ -50,7 +50,7 @@ final class WovenProxyAdapter extends Ab
methodVisitorToReturn = new WovenProxyConcreteMethodAdapter(cv.visitMethod(
access, name, desc, signature, exceptions), access, name, desc,
exceptions, methodStaticFieldName, currentMethod, typeBeingWoven,
- currentMethodDeclaringType);
+ currentMethodDeclaringType, currentMethodDeclaringTypeIsInterface);
} else {
methodVisitorToReturn = cv.visitMethod(access, name, desc, signature, exceptions);
}
Modified: aries/branches/subsystemsR6/proxy/proxy-impl/src/test/java/org/apache/aries/blueprint/proxy/ProxySubclassGeneratorTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-impl/src/test/java/org/apache/aries/blueprint/proxy/ProxySubclassGeneratorTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-impl/src/test/java/org/apache/aries/blueprint/proxy/ProxySubclassGeneratorTest.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-impl/src/test/java/org/apache/aries/blueprint/proxy/ProxySubclassGeneratorTest.java Mon Jun 30 16:54:57 2014
@@ -23,12 +23,20 @@ import static org.junit.Assert.assertFal
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.concurrent.Callable;
import org.apache.aries.proxy.FinalModifierException;
@@ -40,6 +48,7 @@ import org.apache.aries.proxy.impl.Proxy
import org.apache.aries.proxy.impl.SingleInstanceDispatcher;
import org.apache.aries.proxy.impl.gen.ProxySubclassGenerator;
import org.apache.aries.proxy.impl.gen.ProxySubclassMethodHashSet;
+import org.apache.aries.util.io.IOUtils;
import org.junit.Before;
import org.junit.Test;
@@ -236,6 +245,94 @@ public class ProxySubclassGeneratorTest
((FakeInvocationHandler)ih).setDelegate(GENERIC_CLASS.newInstance());
super.testGenerics();
}
+
+ @Test
+ public void testClassLoaders() throws Exception {
+ ClassLoader clA = new LimitedClassLoader("org.apache.aries.proxy.test.a", null, null);
+ ClassLoader clB = new LimitedClassLoader("org.apache.aries.proxy.test.b", "org.apache.aries.proxy.test.a", clA);
+ ClassLoader clC = new LimitedClassLoader("org.apache.aries.proxy.test.c", "org.apache.aries.proxy.test.b", clB);
+
+ Class<?> clazzA = clA.loadClass("org.apache.aries.proxy.test.a.ProxyTestClassA");
+ Class<?> clazzB = clB.loadClass("org.apache.aries.proxy.test.b.ProxyTestClassB");
+ Class<?> clazzC = clC.loadClass("org.apache.aries.proxy.test.c.ProxyTestClassC");
+
+ final Object object = clazzC.getConstructor(String.class).newInstance("hello");
+
+ o = new AsmProxyManager().createNewProxy(null, Arrays.asList(clazzA, clazzB, clazzC), constantly(object), null);
+ generatedProxySubclass = o.getClass();
+ Method m = generatedProxySubclass.getDeclaredMethod("hello", new Class[] {});
+ Object returned = m.invoke(o);
+ assertEquals("hello", returned);
+ }
+
+ private static class LimitedClassLoader extends ClassLoader {
+ Set<String> providedPackages;
+ Set<String> importedPackages;
+ List<ClassLoader> parents;
+
+ public LimitedClassLoader(String provided, String imported, ClassLoader parent) {
+ providedPackages = Collections.singleton(provided);
+ importedPackages = imported != null ? Collections.singleton(imported) : Collections.<String>emptySet();
+ parents = parent != null ? Collections.singletonList(parent) : Collections.<ClassLoader>emptyList();
+ }
+
+ final Map<String, Object> clLocks = new HashMap<String, Object>();
+ protected synchronized Object getClassLoadingLock (String name) {
+ if (!clLocks.containsKey(name)) {
+ clLocks.put(name, new Object());
+ }
+ return clLocks.get(name);
+ }
+
+ @Override
+ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ synchronized (getClassLoadingLock(name)) {
+ // First, check if the class has already been loaded
+ Class<?> c = findLoadedClass(name);
+ if (c == null) {
+ String pkg = name.substring(0, name.lastIndexOf('.'));
+ if (pkg.startsWith("java.") || pkg.startsWith("sun.reflect")) {
+ return getClass().getClassLoader().loadClass(name);
+ } else if (providedPackages.contains(pkg)) {
+ c = findClass(name);
+ } else if (importedPackages.contains(pkg)) {
+ for (ClassLoader cl : parents) {
+ try {
+ c = cl.loadClass(name);
+ } catch (ClassNotFoundException e) {
+ // Ignore
+ }
+ }
+ }
+ }
+ if (c == null) {
+ throw new ClassNotFoundException(name);
+ }
+ if (resolve) {
+ resolveClass(c);
+ }
+ return c;
+ }
+ }
+
+ @Override
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
+ String pkg = name.substring(0, name.lastIndexOf('.'));
+ if (getPackage(pkg) == null) {
+ definePackage(pkg, null, null, null, null, null, null, null);
+ }
+ String path = name.replace('.', '/').concat(".class");
+ InputStream is = LimitedClassLoader.class.getClassLoader().getResourceAsStream(path);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try {
+ IOUtils.copy(is, baos);
+ } catch (IOException e) {
+ throw new ClassNotFoundException(name, e);
+ }
+ byte[] buf = baos.toByteArray();
+ return defineClass(name, buf, 0, buf.length);
+ }
+ }
private Class<?> getGeneratedSubclass() throws Exception
{
@@ -317,4 +414,12 @@ public class ProxySubclassGeneratorTest
protected Object getP3() {
return new ProxyTestClassGeneral();
}
+
+ private Callable<Object> constantly(final Object result) {
+ return new Callable<Object>() {
+ public Object call() throws Exception {
+ return result;
+ }
+ };
+ }
}
Modified: aries/branches/subsystemsR6/proxy/proxy-itests/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-itests/pom.xml?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-itests/pom.xml (original)
+++ aries/branches/subsystemsR6/proxy/proxy-itests/pom.xml Mon Jun 30 16:54:57 2014
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,33 +18,40 @@
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
- <groupId>org.apache.aries</groupId>
- <artifactId>java5-parent</artifactId>
- <version>1.0.0</version>
- <relativePath />
+ <groupId>org.apache.aries</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.apache.aries.proxy</groupId>
<artifactId>org.apache.aries.proxy.itests</artifactId>
<version>1.0.1-SNAPSHOT</version>
-
<name>Apache Aries Proxy iTests</name>
<description>
Integration tests using the standalone proxy-bundle.
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/proxy/proxy-itests</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/proxy/proxy-itests</developerConnection>
- <url>http://svn.apache.org/viewvc/aries/trunk/proxy/proxy-itests</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/proxy/proxy-itests</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/proxy/proxy-itests</developerConnection>
+ <url>http://svn.apache.org/viewvc/aries/trunk/proxy/proxy-itests</url>
</scm>
+ <properties>
+ <exam.version>3.4.0</exam.version>
+ <url.version>1.6.0</url.version>
+ </properties>
+
<dependencies>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <groupId>org.eclipse</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <version>3.8.0.v20120529-1548</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -52,33 +60,16 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- <version>3.7.0.v20110613</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.aries.proxy</groupId>
- <artifactId>org.apache.aries.proxy</artifactId>
- <scope>test</scope>
- <version>1.0.0</version>
- </dependency>
- <dependency>
<groupId>org.apache.aries.proxy</groupId>
<artifactId>org.apache.aries.proxy.api</artifactId>
<scope>test</scope>
- <version>1.0.0</version>
+ <version>1.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.aries.proxy</groupId>
<artifactId>org.apache.aries.proxy.impl</artifactId>
<scope>test</scope>
- <version>1.0.0</version>
+ <version>1.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.aries</groupId>
@@ -87,108 +78,118 @@
<version>1.0.0</version>
</dependency>
<dependency>
- <groupId>org.apache.aries.testsupport</groupId>
- <artifactId>org.apache.aries.testsupport.unit</artifactId>
- <version>1.0.0</version>
- <scope>test</scope>
+ <groupId>org.apache.aries.testsupport</groupId>
+ <artifactId>org.apache.aries.testsupport.unit</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- pax exam -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.7</version>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam</artifactId>
+ <version>${exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-junit</artifactId>
+ <artifactId>pax-exam-container-forked</artifactId>
+ <version>${exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-container-default</artifactId>
+ <artifactId>pax-exam-junit4</artifactId>
+ <version>${exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-junit-extender-impl</artifactId>
+ <artifactId>pax-exam-link-mvn</artifactId>
+ <version>${exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.ops4j.pax.runner</groupId>
- <artifactId>pax-runner-no-jcl</artifactId>
+ <groupId>org.ops4j.pax.url</groupId>
+ <artifactId>pax-url-aether</artifactId>
+ <version>${url.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <version>0.9.29</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.configadmin</artifactId>
- <version>1.2.4</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>0.9.29</version>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.ops4j.pax.logging</groupId>
- <artifactId>pax-logging-api</artifactId>
+ <groupId>org.ops4j.pax.tinybundles</groupId>
+ <artifactId>tinybundles</artifactId>
+ <version>2.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.ops4j.pax.logging</groupId>
- <artifactId>pax-logging-service</artifactId>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm-debug-all</artifactId>
+ <version>5.0.3</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.ops4j.pax.url</groupId>
- <artifactId>pax-url-mvn</artifactId>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-all</artifactId>
- <version>4.0</version>
+ <groupId>org.ops4j.pax.logging</groupId>
+ <artifactId>pax-logging-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.logging</groupId>
+ <artifactId>pax-logging-service</artifactId>
<scope>test</scope>
-
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>pertest</forkMode>
- <excludes>
- <exclude>**/*$*</exclude>
- <exclude>**/Abstract*.java</exclude>
- </excludes>
- <includes>
- <include>**/Test*.java</include>
- <include>**/*Test.java</include>
- </includes>
</configuration>
</plugin>
<plugin>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>maven-paxexam-plugin</artifactId>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>depends-maven-plugin</artifactId>
+ <version>1.2</version>
<executions>
<execution>
- <id>generate-config</id>
+ <id>generate-depends-file</id>
<goals>
<goal>generate-depends-file</goal>
</goals>
- <configuration>
- <outputFile>${project.build.directory}/test-classes/META-INF/maven/dependencies.properties</outputFile>
- </configuration>
</execution>
</executions>
</plugin>
Modified: aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractBasicProxyTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractBasicProxyTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractBasicProxyTest.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractBasicProxyTest.java Mon Jun 30 16:54:57 2014
@@ -20,27 +20,17 @@ package org.apache.aries.proxy.itests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.apache.aries.itest.ExtraOptions.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.Callable;
import org.apache.aries.proxy.FinalModifierException;
-import org.apache.aries.proxy.ProxyManager;
import org.apache.aries.proxy.UnableToProxyException;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.osgi.framework.Bundle;
-import org.osgi.framework.FrameworkUtil;
-import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
-@RunWith(JUnit4TestRunner.class)
-public class AbstractBasicProxyTest extends AbstractProxyTest
+public abstract class AbstractBasicProxyTest extends AbstractProxyTest
{
/**
* This test does two things. First of all it checks that we throw a FinalModifierException if we
@@ -50,8 +40,7 @@ public class AbstractBasicProxyTest exte
@Test
public void checkProxyFinalClass() throws UnableToProxyException
{
- ProxyManager mgr = context().getService(ProxyManager.class);
- Bundle b = FrameworkUtil.getBundle(this.getClass());
+ Bundle b = bundleContext.getBundle();
Callable<Object> c = new TestCallable();
Collection<Class<?>> classes = new ArrayList<Class<?>>();
classes.add(TestCallable.class);
@@ -71,8 +60,7 @@ public class AbstractBasicProxyTest exte
@Test
public void checkProxyFinalMethods() throws UnableToProxyException
{
- ProxyManager mgr = context().getService(ProxyManager.class);
- Bundle b = FrameworkUtil.getBundle(this.getClass());
+ Bundle b = bundleContext.getBundle();
Callable<Object> c = new TestCallable();
Collection<Class<?>> classes = new ArrayList<Class<?>>();
Runnable r = new Runnable() {
Modified: aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractProxyTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractProxyTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractProxyTest.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractProxyTest.java Mon Jun 30 16:54:57 2014
@@ -18,14 +18,16 @@
*/
package org.apache.aries.proxy.itests;
-import static org.apache.aries.itest.ExtraOptions.flatOptions;
-import static org.apache.aries.itest.ExtraOptions.mavenBundle;
-import static org.apache.aries.itest.ExtraOptions.paxLogging;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
+import static org.ops4j.pax.exam.CoreOptions.composite;
+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.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.when;
import java.lang.reflect.Method;
import java.util.AbstractList;
@@ -34,16 +36,25 @@ import java.util.Collection;
import java.util.List;
import java.util.concurrent.Callable;
+import javax.inject.Inject;
+
import org.apache.aries.itest.AbstractIntegrationTest;
import org.apache.aries.proxy.InvocationListener;
import org.apache.aries.proxy.ProxyManager;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
import org.osgi.framework.Bundle;
-import org.osgi.framework.FrameworkUtil;
-public class AbstractProxyTest extends AbstractIntegrationTest {
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public abstract class AbstractProxyTest extends AbstractIntegrationTest {
+ @Inject
+ ProxyManager mgr;
public final static class TestCallable implements Callable<Object> {
private Object list = new ArrayList<Object>();
@@ -141,11 +152,9 @@ public class AbstractProxyTest extends A
}
}
- @SuppressWarnings("unchecked")
@Test
public void testEquals() throws Exception {
- ProxyManager mgr = context().getService(ProxyManager.class);
- Bundle b = FrameworkUtil.getBundle(this.getClass());
+ Bundle b = bundleContext.getBundle();
TestCallable c = new TestCallable();
c.setReturn(new TestDelegate("One"));
@@ -165,8 +174,7 @@ public class AbstractProxyTest extends A
@Test
public void testDelegation() throws Exception {
- ProxyManager mgr = context().getService(ProxyManager.class);
- Bundle b = FrameworkUtil.getBundle(this.getClass());
+ Bundle b = bundleContext.getBundle();
TestCallable c = new TestCallable();
@@ -185,8 +193,7 @@ public class AbstractProxyTest extends A
@Test
public void testInterception() throws Exception {
- ProxyManager mgr = context().getService(ProxyManager.class);
- Bundle b = FrameworkUtil.getBundle(this.getClass());
+ Bundle b = bundleContext.getBundle();
TestDelegate td = new TestDelegate("Hello");
@@ -226,9 +233,7 @@ public class AbstractProxyTest extends A
@Test
public void testDelegationAndInterception() throws Exception {
- ProxyManager mgr = context().getService(ProxyManager.class);
- Bundle b = FrameworkUtil.getBundle(this.getClass());
-
+ Bundle b = bundleContext.getBundle();
TestCallable c = new TestCallable();
@@ -282,48 +287,40 @@ public class AbstractProxyTest extends A
assertEquals(ex, listener.postInvokeExceptionalReturn);
}
- protected static Option[] generalOptions() {
- return flatOptions(paxLogging("DEBUG"),
-
- // Bundles
- mavenBundle("org.apache.aries", "org.apache.aries.util"),
- mavenBundle("org.ow2.asm", "asm-all"),
- // don't install the blueprint sample here as it will be installed onto the same framework as the blueprint core bundle
- // mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.sample").noStart(),
- mavenBundle("org.osgi", "org.osgi.compendium")
+ protected Option generalOptions() {
+ String localRepo = System.getProperty("maven.repo.local");
+ if (localRepo == null) {
+ localRepo = System.getProperty("org.ops4j.pax.url.mvn.localRepository");
+ }
+ return composite(
+ junitBundles(),
+ systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
+ when(localRepo != null).useOptions(CoreOptions.vmOption("-Dorg.ops4j.pax.url.mvn.localRepository=" + localRepo)),
+ mavenBundle("org.apache.aries", "org.apache.aries.util").versionAsInProject(),
+ mavenBundle("org.ow2.asm", "asm-debug-all").versionAsInProject(),
+ mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject()
/* vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
waitForFrameworkStartup(),*/
);
-
}
- protected static Option[] proxyBundles()
+ protected Option[] proxyBundles()
{
- return new Option[] {
- mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy.api"),
- mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy.impl"),
- };
+ return options(
+ generalOptions(),
+ mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy.api").versionAsInProject(),
+ mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy.impl").versionAsInProject()
+ );
}
- protected static Option[] proxyUberBundle()
+ protected Option[] proxyUberBundle()
{
- return new Option[] {
- mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy"),
- };
+ return options(
+ generalOptions(),
+ mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy").version("1.0.2-SNAPSHOT")
+ );
}
- protected static Option[] equinox35()
- {
- return new Option[] {
- equinox().version("3.5.0")
- };
- }
-
- protected static Option[] equinox37()
- {
- return new Option[] {
- PaxRunnerOptions.rawPaxRunnerOption("config", "classpath:ss-runner.properties"),
- equinox().version("3.7.0.v20110613")
- };
- }
}
Modified: aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractWeavingProxyTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractWeavingProxyTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractWeavingProxyTest.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/AbstractWeavingProxyTest.java Mon Jun 30 16:54:57 2014
@@ -18,12 +18,8 @@
*/
package org.apache.aries.proxy.itests;
-import static org.apache.aries.itest.ExtraOptions.mavenBundle;
-import static org.apache.aries.itest.ExtraOptions.paxLogging;
-import static org.apache.aries.itest.ExtraOptions.testOptions;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
import java.util.AbstractList;
import java.util.ArrayList;
@@ -31,21 +27,17 @@ import java.util.Collection;
import java.util.concurrent.Callable;
import org.apache.aries.proxy.FinalModifierException;
-import org.apache.aries.proxy.ProxyManager;
import org.apache.aries.proxy.weaving.WovenProxy;
import org.apache.aries.proxy.weavinghook.ProxyWeavingController;
import org.apache.aries.proxy.weavinghook.WeavingHelper;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+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.FrameworkUtil;
import org.osgi.framework.hooks.weaving.WovenClass;
-@RunWith(JUnit4TestRunner.class)
-public class AbstractWeavingProxyTest extends AbstractProxyTest
+@ExamReactorStrategy(PerMethod.class)
+public abstract class AbstractWeavingProxyTest extends AbstractProxyTest
{
/**
@@ -56,13 +48,13 @@ public class AbstractWeavingProxyTest ex
@Test
public void checkProxyFinalClass() throws Exception
{
- ProxyManager mgr = context().getService(ProxyManager.class);
- Bundle b = FrameworkUtil.getBundle(this.getClass());
+ Bundle b = bundleContext.getBundle();
TestCallable dispatcher = new TestCallable();
TestCallable template = new TestCallable();
Collection<Class<?>> classes = new ArrayList<Class<?>>();
classes.add(TestCallable.class);
- Callable<Object> o = (Callable<Object>) mgr.createDelegatingProxy(b, classes,
+ @SuppressWarnings("unchecked")
+ Callable<Object> o = (Callable<Object>) mgr.createDelegatingProxy(b, classes,
dispatcher, template);
if(!!!(o instanceof WovenProxy))
fail("Proxy should be woven!");
@@ -80,8 +72,7 @@ public class AbstractWeavingProxyTest ex
@Test
public void checkProxyFinalMethods() throws Exception
{
- ProxyManager mgr = context().getService(ProxyManager.class);
- Bundle b = FrameworkUtil.getBundle(this.getClass());
+ Bundle b = bundleContext.getBundle();
Callable<Object> c = new TestCallable();
Collection<Class<?>> classes = new ArrayList<Class<?>>();
Runnable r = new Runnable() {
@@ -106,8 +97,7 @@ public class AbstractWeavingProxyTest ex
}
}, null);
- ProxyManager mgr = context().getService(ProxyManager.class);
- Bundle b = FrameworkUtil.getBundle(this.getClass());
+ Bundle b = bundleContext.getBundle();
Callable<Object> c = new TestCallable();
Collection<Class<?>> classes = new ArrayList<Class<?>>();
// Don't use anonymous inner class in this test as IBM and Sun load it at a different time
@@ -124,21 +114,18 @@ public class AbstractWeavingProxyTest ex
@Override
public String get(int location)
{
-
return null;
}
@Override
public int size()
{
-
return 0;
}
public final String call() throws Exception
{
-
return null;
}
}
-}
\ No newline at end of file
+}
Modified: aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/BasicProxyBundlesTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/BasicProxyBundlesTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/BasicProxyBundlesTest.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/BasicProxyBundlesTest.java Mon Jun 30 16:54:57 2014
@@ -18,31 +18,8 @@
*/
package org.apache.aries.proxy.itests;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.apache.aries.itest.ExtraOptions.*;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.concurrent.Callable;
-
-import org.apache.aries.itest.AbstractIntegrationTest;
-import org.apache.aries.proxy.FinalModifierException;
-import org.apache.aries.proxy.ProxyManager;
-import org.apache.aries.proxy.UnableToProxyException;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
-import org.ops4j.pax.exam.container.def.options.CleanCachesOption;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.FrameworkUtil;
-import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
/**
* This test runs the basic proxy tests for the proxy bundles (not the uber bundle).
@@ -51,24 +28,11 @@ import static org.ops4j.pax.exam.contain
* uber-bundle, which means we test nothing.
*
*/
-@RunWith(JUnit4TestRunner.class)
public class BasicProxyBundlesTest extends AbstractBasicProxyTest
{
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration35IndividualBundles() {
- return testOptions(
- generalOptions(),
- proxyBundles(),
- equinox35()
- );
+ @Configuration
+ public Option[] configuration() {
+ return proxyBundles();
}
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration37IndividualBundles() {
- return testOptions(
- generalOptions(),
- proxyBundles(),
- equinox37()
- );
- }
}
\ No newline at end of file
Modified: aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/BasicProxyUberBundleTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/BasicProxyUberBundleTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/BasicProxyUberBundleTest.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/BasicProxyUberBundleTest.java Mon Jun 30 16:54:57 2014
@@ -18,31 +18,8 @@
*/
package org.apache.aries.proxy.itests;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.apache.aries.itest.ExtraOptions.*;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.concurrent.Callable;
-
-import org.apache.aries.itest.AbstractIntegrationTest;
-import org.apache.aries.proxy.FinalModifierException;
-import org.apache.aries.proxy.ProxyManager;
-import org.apache.aries.proxy.UnableToProxyException;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
-import org.ops4j.pax.exam.container.def.options.CleanCachesOption;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.FrameworkUtil;
-import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
/**
* This test runs the basic proxy tests for the proxy uber bundle.
@@ -51,26 +28,12 @@ import static org.ops4j.pax.exam.contain
* uber-bundle, which means we test nothing.
*
*/
-@RunWith(JUnit4TestRunner.class)
public class BasicProxyUberBundleTest extends AbstractBasicProxyTest
{
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration35UberBundle() {
- return testOptions(
- generalOptions(),
- proxyUberBundle(),
- equinox35()
- );
- }
-
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration37UberBundle() {
- return testOptions(
- generalOptions(),
- proxyUberBundle(),
- equinox37()
- );
+ @Configuration
+ public Option[] configuration() {
+ return proxyUberBundle();
}
}
\ No newline at end of file
Modified: aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/WeavingProxyBundlesTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/WeavingProxyBundlesTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/WeavingProxyBundlesTest.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/WeavingProxyBundlesTest.java Mon Jun 30 16:54:57 2014
@@ -18,31 +18,8 @@
*/
package org.apache.aries.proxy.itests;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.apache.aries.itest.ExtraOptions.*;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.concurrent.Callable;
-
-import org.apache.aries.itest.AbstractIntegrationTest;
-import org.apache.aries.proxy.FinalModifierException;
-import org.apache.aries.proxy.ProxyManager;
-import org.apache.aries.proxy.UnableToProxyException;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
-import org.ops4j.pax.exam.container.def.options.CleanCachesOption;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.FrameworkUtil;
-import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
/**
* This test runs the weaving proxy tests for the proxy bundles (not the uber bundle).
@@ -51,15 +28,10 @@ import static org.ops4j.pax.exam.contain
* uber-bundle, which means we test nothing.
*
*/
-@RunWith(JUnit4TestRunner.class)
public class WeavingProxyBundlesTest extends AbstractWeavingProxyTest
{
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration37IndividualBundles() {
- return testOptions(
- generalOptions(),
- proxyBundles(),
- equinox37()
- );
+ @Configuration
+ public Option[] configuration() {
+ return proxyBundles();
}
}
\ No newline at end of file
Modified: aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/WeavingProxyUberBundleTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/WeavingProxyUberBundleTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/WeavingProxyUberBundleTest.java (original)
+++ aries/branches/subsystemsR6/proxy/proxy-itests/src/test/java/org/apache/aries/proxy/itests/WeavingProxyUberBundleTest.java Mon Jun 30 16:54:57 2014
@@ -18,31 +18,8 @@
*/
package org.apache.aries.proxy.itests;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.apache.aries.itest.ExtraOptions.*;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.concurrent.Callable;
-
-import org.apache.aries.itest.AbstractIntegrationTest;
-import org.apache.aries.proxy.FinalModifierException;
-import org.apache.aries.proxy.ProxyManager;
-import org.apache.aries.proxy.UnableToProxyException;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
-import org.ops4j.pax.exam.container.def.options.CleanCachesOption;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.FrameworkUtil;
-import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
/**
* This test runs the weaving proxy tests for the proxy uber bundle.
@@ -51,16 +28,11 @@ import static org.ops4j.pax.exam.contain
* uber-bundle, which means we test nothing.
*
*/
-@RunWith(JUnit4TestRunner.class)
public class WeavingProxyUberBundleTest extends AbstractWeavingProxyTest
{
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration37UberBundle() {
- return testOptions(
- generalOptions(),
- proxyUberBundle(),
- equinox37()
- );
+ @Configuration
+ public Option[] configuration() {
+ return proxyUberBundle();
}
}
\ No newline at end of file
Modified: aries/branches/subsystemsR6/quiesce/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/quiesce/pom.xml?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/quiesce/pom.xml (original)
+++ aries/branches/subsystemsR6/quiesce/pom.xml Mon Jun 30 16:54:57 2014
@@ -1,35 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- 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.
+ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.apache.aries</groupId>
- <artifactId>java5-parent</artifactId>
- <version>1.0.0</version>
- <relativePath />
+ <artifactId>parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
- <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.aries.quiesce</groupId>
<artifactId>quiesce</artifactId>
<name>Apache Aries Quiesce</name>
<packaging>pom</packaging>
<version>1.0.1-SNAPSHOT</version>
-
<description>
Quiesce support for Aries - reactor pom
</description>
@@ -37,7 +40,7 @@
<modules>
<module>quiesce-api</module>
<module>quiesce-manager</module>
- <module>quiesce-manager-itest</module>
+ <module>quiesce-manager-itest</module>
</modules>
</project>
Modified: aries/branches/subsystemsR6/quiesce/quiesce-api/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/quiesce/quiesce-api/pom.xml?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/quiesce/quiesce-api/pom.xml (original)
+++ aries/branches/subsystemsR6/quiesce/quiesce-api/pom.xml Mon Jun 30 16:54:57 2014
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,12 +18,14 @@
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
- <groupId>org.apache.aries</groupId>
- <artifactId>java5-parent</artifactId>
- <version>1.0.0</version>
- <relativePath />
+ <groupId>org.apache.aries</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.apache.aries.quiesce</groupId>
@@ -31,22 +34,22 @@
<name>Apache Aries Quiesce API</name>
<version>1.0.1-SNAPSHOT</version>
<description>
- Quiesce API.
+ Quiesce API.
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/quiesce/quiesce-api</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/quiesce/quiesce-api</developerConnection>
- <url>http://svn.apache.org/viewvc/aries/trunk/quiesce/quiesce-api</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/quiesce/quiesce-api</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/quiesce/quiesce-api</developerConnection>
+ <url>http://svn.apache.org/viewvc/aries/trunk/quiesce/quiesce-api</url>
</scm>
<properties>
<!-- Export package versions are maintained in packageinfo files -->
-
<aries.osgi.export.pkg>
org.apache.aries.quiesce.manager;
org.apache.aries.quiesce.participant;
</aries.osgi.export.pkg>
+ <lastReleaseVersion>1.0.0</lastReleaseVersion>
</properties>
<dependencies>
@@ -56,12 +59,12 @@
<scope>provided</scope>
</dependency>
</dependencies>
+
<build>
<plugins>
<plugin>
<groupId>org.apache.aries.versioning</groupId>
<artifactId>org.apache.aries.versioning.plugin</artifactId>
- <version>0.1.0</version>
<executions>
<execution>
<id>default-verify</id>
@@ -69,9 +72,6 @@
<goals>
<goal>version-check</goal>
</goals>
- <configuration>
- <oldArtifact>org.apache.aries.quiesce:org.apache.aries.quiesce.api:1.0.0</oldArtifact>
- </configuration>
</execution>
</executions>
</plugin>
Modified: aries/branches/subsystemsR6/quiesce/quiesce-manager-itest/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/quiesce/quiesce-manager-itest/pom.xml?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/quiesce/quiesce-manager-itest/pom.xml (original)
+++ aries/branches/subsystemsR6/quiesce/quiesce-manager-itest/pom.xml Mon Jun 30 16:54:57 2014
@@ -1,31 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- 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.
+ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
- <groupId>org.apache.aries</groupId>
- <artifactId>java5-parent</artifactId>
- <version>1.0.0</version>
- <relativePath />
+ <groupId>org.apache.aries</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
- <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.aries.quiesce</groupId>
<artifactId>org.apache.aries.quiesce.manager.itest</artifactId>
<version>1.0.1-SNAPSHOT</version>
@@ -39,6 +41,11 @@
<dependencies>
<dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <version>3.8.0.v20120529-1548</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.aries.quiesce</groupId>
<artifactId>org.apache.aries.quiesce.api</artifactId>
<version>1.0.0</version>
@@ -51,16 +58,18 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.apache.aries.testsupport</groupId>
- <artifactId>org.apache.aries.testsupport.unit</artifactId>
- <version>1.0.0</version>
- <scope>test</scope>
+ <groupId>org.apache.aries.testsupport</groupId>
+ <artifactId>org.apache.aries.testsupport.unit</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>test</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
</dependency>
+ -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
@@ -83,19 +92,34 @@
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-container-default</artifactId>
+ <artifactId>pax-exam</artifactId>
+ <version>3.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-junit</artifactId>
+ <artifactId>pax-exam-container-native</artifactId>
+ <version>3.4.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-junit4</artifactId>
+ <version>3.4.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-link-mvn</artifactId>
+ <version>3.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.url</groupId>
- <artifactId>pax-url-mvn</artifactId>
+ <artifactId>pax-url-aether</artifactId>
+ <version>1.6.0</version>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.aries</groupId>
<artifactId>org.apache.aries.util</artifactId>
@@ -103,19 +127,19 @@
<version>1.0.0</version>
</dependency>
<dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.configadmin</artifactId>
- <version>1.2.4</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.configadmin</artifactId>
+ <version>1.2.4</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
@@ -139,7 +163,7 @@
<artifactId>org.apache.servicemix.bundles.serp</artifactId>
<version>1.13.1_2</version>
</dependency>
- </dependencies>
+ </dependencies>
<build>
<plugins>
@@ -185,4 +209,5 @@
</build>
</profile>
</profiles>
+
</project>
Modified: aries/branches/subsystemsR6/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java (original)
+++ aries/branches/subsystemsR6/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java Mon Jun 30 16:54:57 2014
@@ -15,10 +15,6 @@
*/
package org.apache.aries.quiesce.manager.itest;
-import static org.junit.Assert.*;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.apache.aries.itest.ExtraOptions.*;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -33,11 +29,26 @@ import org.junit.After;
import org.junit.Before;
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.JUnit4TestRunner;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
import org.osgi.framework.Bundle;
-@RunWith(JUnit4TestRunner.class)
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.vmOption;
+import static org.ops4j.pax.exam.CoreOptions.when;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
public class QuiesceManagerTest extends AbstractIntegrationTest {
private QuiesceManager manager;
private Bundle b1;
@@ -266,24 +277,35 @@ public class QuiesceManagerTest extends
assertTrue("Bundle "+b3.getSymbolicName()+" should not be in active state", b3.getState() != Bundle.ACTIVE);
}
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration() {
- return testOptions(
- paxLogging("DEBUG"),
+ public Option baseOptions() {
+ String localRepo = getLocalRepo();
+ return composite(
+ junitBundles(),
+ // this is how you set the default log level when using pax
+ // logging (logProfile)
+ systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
+ when(localRepo != null).useOptions(vmOption("-Dorg.ops4j.pax.url.mvn.localRepository=" + localRepo))
+ );
+ }
+ @Configuration
+ public Option[] configuration() {
+ return new Option[]{
+ baseOptions(),
// Bundles
- mavenBundle("org.osgi", "org.osgi.compendium"),
- mavenBundle("org.apache.aries", "org.apache.aries.util"),
- mavenBundle("commons-lang", "commons-lang"),
- mavenBundle("commons-collections", "commons-collections"),
- mavenBundle("commons-pool", "commons-pool"),
- mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.serp"),
- mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.api"),
- mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.manager"),
-
+ mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
+ mavenBundle("org.apache.aries", "org.apache.aries.util").versionAsInProject(),
+ mavenBundle("commons-lang", "commons-lang").versionAsInProject(),
+ mavenBundle("commons-collections", "commons-collections").versionAsInProject(),
+ mavenBundle("commons-pool", "commons-pool").versionAsInProject(),
+ mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.serp").versionAsInProject(),
+ mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.api").versionAsInProject(),
+ mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.manager").versionAsInProject(),
+ mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
+
//new VMOption( "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" ),
//new TimeoutOption( 0 ),
- equinox().version("3.5.0"));
+ };
}
}
Modified: aries/branches/subsystemsR6/quiesce/quiesce-manager/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/quiesce/quiesce-manager/pom.xml?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/quiesce/quiesce-manager/pom.xml (original)
+++ aries/branches/subsystemsR6/quiesce/quiesce-manager/pom.xml Mon Jun 30 16:54:57 2014
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,12 +18,14 @@
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
- <groupId>org.apache.aries</groupId>
- <artifactId>java5-parent</artifactId>
- <version>1.0.0</version>
- <relativePath />
+ <groupId>org.apache.aries</groupId>
+ <artifactId>parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.apache.aries.quiesce</groupId>
@@ -31,18 +34,17 @@
<version>1.0.1-SNAPSHOT</version>
<name>Apache Aries Quiesce Manager</name>
<description>
- Quiesce Manager.
+ Quiesce Manager.
</description>
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/quiesce/quiesce-manager</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/quiesce/quiesce-manager</developerConnection>
- <url>http://svn.apache.org/viewvc/aries/trunk/quiesce/quiesce-manager</url>
- </scm>
-
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/quiesce/quiesce-manager</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/quiesce/quiesce-manager</developerConnection>
+ <url>http://svn.apache.org/viewvc/aries/trunk/quiesce/quiesce-manager</url>
+ </scm>
<properties>
- <aries.osgi.export.pkg />
+ <aries.osgi.export.pkg/>
<aries.osgi.private.pkg>
org.apache.aries.quiesce.manager.impl
</aries.osgi.private.pkg>
@@ -52,6 +54,7 @@
<aries.osgi.export.service>
org.apache.aries.quiesce.manager.QuiesceManager
</aries.osgi.export.service>
+ <lastReleaseVersion>1.0.0</lastReleaseVersion>
</properties>
<dependencies>
@@ -86,12 +89,12 @@
<scope>test</scope>
</dependency>
</dependencies>
+
<build>
<plugins>
<plugin>
<groupId>org.apache.aries.versioning</groupId>
<artifactId>org.apache.aries.versioning.plugin</artifactId>
- <version>0.1.0</version>
<executions>
<execution>
<id>default-verify</id>
@@ -99,14 +102,10 @@
<goals>
<goal>version-check</goal>
</goals>
- <configuration>
- <oldArtifact>org.apache.aries.quiesce:org.apache.aries.quiesce.manager:1.0.0</oldArtifact>
- </configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
-
</project>
Modified: aries/branches/subsystemsR6/samples/ariestrader/assemblies/equinox-test-harness/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/samples/ariestrader/assemblies/equinox-test-harness/pom.xml?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/samples/ariestrader/assemblies/equinox-test-harness/pom.xml (original)
+++ aries/branches/subsystemsR6/samples/ariestrader/assemblies/equinox-test-harness/pom.xml Mon Jun 30 16:54:57 2014
@@ -38,14 +38,17 @@
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>osgi</artifactId>
+ <version>3.5.0.v20090520</version>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>cm</artifactId>
+ <version>3.2.0-v20070116</version>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>services</artifactId>
+ <version>3.1.200-v20070605</version>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
Modified: aries/branches/subsystemsR6/samples/blog/blog-assembly/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/samples/blog/blog-assembly/pom.xml?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/samples/blog/blog-assembly/pom.xml (original)
+++ aries/branches/subsystemsR6/samples/blog/blog-assembly/pom.xml Mon Jun 30 16:54:57 2014
@@ -39,11 +39,13 @@
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>cm</artifactId>
+ <version>3.2.0-v20070116</version>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>services</artifactId>
+ <version>3.1.200-v20070605</version>
</dependency>
<dependency>