You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by oz...@apache.org on 2010/01/11 15:37:47 UTC

svn commit: r897881 [2/2] - in /incubator/aries/trunk/blueprint/blueprint-core: ./ src/main/java/org/apache/aries/blueprint/container/ src/main/java/org/apache/aries/blueprint/proxy/ src/test/java/org/apache/aries/blueprint/proxy/

Added: incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxySubclassGeneratorTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxySubclassGeneratorTest.java?rev=897881&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxySubclassGeneratorTest.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxySubclassGeneratorTest.java Mon Jan 11 14:37:45 2010
@@ -0,0 +1,364 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+import static org.junit.Assert.*;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.aries.blueprint.proxy.FinalModifierException;
+import org.apache.aries.blueprint.proxy.ProxySubclassGenerator;
+import org.apache.aries.blueprint.proxy.ProxySubclassMethodHashSet;
+
+public class ProxySubclassGeneratorTest
+{
+  private static final Class<?> TEST_CLASS = ProxyTestClassGeneral.class;
+  private static final Class<?> FINAL_METHOD_CLASS = ProxyTestClassFinalMethod.class;
+  private static final Class<?> FINAL_CLASS = ProxyTestClassFinal.class;
+  private static final Class<?> GENERIC_CLASS = ProxyTestClassGeneric.class;
+  private static final Class<?> COVARIANT_CLASS = ProxyTestClassCovariantOverride.class;
+  private static ProxySubclassMethodHashSet<String> expectedMethods = new ProxySubclassMethodHashSet<String>(
+      12);
+  private InvocationHandler ih = null;
+  private Class<?> generatedProxySubclass = null;
+  private Object o = null;
+
+  /**
+   * @throws java.lang.Exception
+   */
+  @Before
+  public void setUp() throws Exception
+  {
+    ih = new FakeInvocationHandler();
+    ((FakeInvocationHandler)ih).setDelegate(TEST_CLASS.newInstance());
+    generatedProxySubclass = getGeneratedSubclass();
+    o = getSubclassInstance(generatedProxySubclass);
+  }
+
+  /**
+   * This test uses the ProxySubclassGenerator to generate and load a subclass
+   * of the specified TEST_CLASS.
+   * 
+   * Once the subclass is generated we check that it wasn't null. We check
+   * that the InvocationHandler constructor doesn't return a null object
+   * either
+   * 
+   * Test method for
+   * {@link com.ibm.osgi.blueprint.internal.proxy.ProxySubclassGenerator#generateAndLoadSubclass()}
+   * .
+   */
+  @Test
+  public void testGenerateAndLoadSubclass() throws Exception
+  {
+    assertNotNull("Generated proxy subclass was null", generatedProxySubclass);
+    assertNotNull("Generated proxy subclass instance was null", o);
+  }
+
+  /**
+   * Test that the methods found declared on the generated proxy subclass are
+   * the ones that we expect.
+   */
+  @Test
+  public void testExpectedMethods() throws Exception
+  {
+    Class<?> superclass = TEST_CLASS;
+
+    do {
+      Method[] declaredMethods = superclass.getDeclaredMethods();
+      List<Method> listOfDeclaredMethods = new ArrayList<Method>();
+      for (Method m : declaredMethods) {
+        int i = m.getModifiers();
+        if (Modifier.isPrivate(i) || Modifier.isFinal(i)) {
+          // private or final don't get added
+        } else if (!(Modifier.isPublic(i) || Modifier.isPrivate(i) || Modifier.isProtected(i))) {
+          // the method is default visibility, check the package
+          if (m.getDeclaringClass().getPackage().equals(TEST_CLASS.getPackage())) {
+            // default vis with same package gets added
+            listOfDeclaredMethods.add(m);
+          }
+        } else {
+          listOfDeclaredMethods.add(m);
+        }
+      }
+
+      declaredMethods = listOfDeclaredMethods.toArray(new Method[] {});
+      ProxySubclassMethodHashSet<String> foundMethods = new ProxySubclassMethodHashSet<String>(
+          declaredMethods.length);
+      foundMethods.addMethodArray(declaredMethods);
+      // as we are using a set we shouldn't get duplicates
+      expectedMethods.addAll(foundMethods);
+      superclass = superclass.getSuperclass();
+    } while (superclass != null);
+
+    // add the getter and setter for the invocation handler to the expected
+    // set
+    // and the unwrapObject method
+    Method[] ihMethods = new Method[] {
+        generatedProxySubclass.getMethod("setInvocationHandler",
+            new Class[] { InvocationHandler.class }),
+        generatedProxySubclass.getMethod("getInvocationHandler", new Class[] {}) };
+    expectedMethods.addMethodArray(ihMethods);
+
+    Method[] generatedProxySubclassMethods = generatedProxySubclass.getDeclaredMethods();
+    ProxySubclassMethodHashSet<String> generatedMethods = new ProxySubclassMethodHashSet<String>(
+        generatedProxySubclassMethods.length);
+    generatedMethods.addMethodArray(generatedProxySubclassMethods);
+
+    // check that all the methods we have generated were expected
+    for (String gen : generatedMethods) {
+      assertTrue("Unexpected method: " + gen, expectedMethods.contains(gen));
+    }
+    // check that all the expected methods were generated
+    for (String exp : expectedMethods) {
+      assertTrue("Method was not generated: " + exp, generatedMethods.contains(exp));
+    }
+    // check the sets were the same
+    assertEquals("Sets were not the same", expectedMethods, generatedMethods);
+
+  }
+
+  /**
+   * Test a basic method invocation on the proxy subclass
+   */
+  @Test
+  public void testMethodInvocation() throws Exception
+  {
+    Method m = generatedProxySubclass.getDeclaredMethod("testMethod", new Class[] { String.class,
+        int.class, Object.class });
+    String x = "x";
+    String returned = (String) m.invoke(o, x, 1, new Object());
+    assertEquals("Object returned from invocation was not correct.", x, returned);
+  }
+
+  /**
+   * Test different argument types on a method invocation
+   */
+  @Test
+  public void testMethodArgs() throws Exception
+  {
+    Method m = generatedProxySubclass.getDeclaredMethod("testArgs", new Class[] { double.class,
+        short.class, long.class, char.class, byte.class, boolean.class });
+    Character xc = Character.valueOf('x');
+    String x = xc.toString();
+    String returned = (String) m.invoke(o, Double.MAX_VALUE, Short.MIN_VALUE, Long.MAX_VALUE, xc
+        .charValue(), Byte.MIN_VALUE, false);
+    assertEquals("Object returned from invocation was not correct.", x, returned);
+  }
+
+  /**
+   * Test a method that returns void
+   */
+  @Test
+  public void testReturnVoid() throws Exception
+  {
+    Method m = generatedProxySubclass.getDeclaredMethod("testReturnVoid", new Class[] {});
+    m.invoke(o);
+  }
+
+  /**
+   * Test a method that returns an int
+   */
+  @Test
+  public void testReturnInt() throws Exception
+  {
+    Method m = generatedProxySubclass.getDeclaredMethod("testReturnInt", new Class[] {});
+    Integer returned = (Integer) m.invoke(o);
+    assertEquals("Expected object was not returned from invocation", Integer.valueOf(17), returned);
+  }
+
+  /**
+   * Test a method that returns an Integer
+   */
+  @Test
+  public void testReturnInteger() throws Exception
+  {
+    Method m = generatedProxySubclass.getDeclaredMethod("testReturnInteger", new Class[] {});
+    Integer returned = (Integer) m.invoke(o);
+    assertEquals("Expected object was not returned from invocation", Integer.valueOf(1), returned);
+  }
+
+  /**
+   * Test a public method declared higher up the superclass hierarchy
+   */
+  @Test
+  public void testPublicHierarchyMethod() throws Exception
+  {
+    Method m = generatedProxySubclass.getDeclaredMethod("bMethod", new Class[] {});
+    m.invoke(o);
+  }
+
+  /**
+   * Test a protected method declared higher up the superclass hierarchy
+   */
+  @Test
+  public void testProtectedHierarchyMethod() throws Exception
+  {
+    Method m = generatedProxySubclass.getDeclaredMethod("bProMethod", new Class[] {});
+    m.invoke(o);
+  }
+
+  /**
+   * Test a default method declared higher up the superclass hierarchy
+   */
+  @Test
+  public void testDefaultHierarchyMethod() throws Exception
+  {
+    Method m = generatedProxySubclass.getDeclaredMethod("bDefMethod", new Class[] {});
+    m.invoke(o);
+  }
+
+  /**
+   * Test a covariant override method
+   */
+  @Test
+  public void testCovariant() throws Exception
+  {
+    ((FakeInvocationHandler)ih).setDelegate(COVARIANT_CLASS.newInstance());
+    o = ProxySubclassGenerator.newProxySubclassInstance(COVARIANT_CLASS, ih);
+    generatedProxySubclass = o.getClass();
+    Method m = generatedProxySubclass.getDeclaredMethod("getCovariant", new Class[] {});
+    Object returned = m.invoke(o);
+    assertTrue("Object was of wrong type: " + returned.getClass().getSimpleName(), COVARIANT_CLASS
+        .isInstance(returned));
+  }
+
+  /**
+   * Test a method with generics
+   */
+  @Test
+  public void testGenerics() throws Exception
+  {
+    ((FakeInvocationHandler)ih).setDelegate(GENERIC_CLASS.newInstance());
+    o = ProxySubclassGenerator.newProxySubclassInstance(GENERIC_CLASS, ih);
+    generatedProxySubclass = o.getClass();
+    Method m = generatedProxySubclass.getDeclaredMethod("setSomething",
+        new Class[] { String.class });
+    m.invoke(o, "aString");
+    m = generatedProxySubclass.getDeclaredMethod("getSomething", new Class[] {});
+    Object returned = m.invoke(o);
+    assertTrue("Object was of wrong type", String.class.isInstance(returned));
+    assertEquals("String had wrong value", "aString", returned);
+  }
+
+  /**
+   * Test a method marked final
+   */
+  @Test
+  public void testFinalMethod() throws Exception
+  {
+    try {
+      ProxySubclassGenerator.getProxySubclass(FINAL_METHOD_CLASS);
+    } catch (FinalModifierException e) {
+      assertFalse("Should have found final method not final class", e.isFinalClass());
+    }
+  }
+
+  /**
+   * Test a class marked final
+   */
+  @Test
+  public void testFinalClass() throws Exception
+  {
+    try {
+      ProxySubclassGenerator.getProxySubclass(FINAL_CLASS);
+    } catch (FinalModifierException e) {
+      assertTrue("Should have found final class", e.isFinalClass());
+    }
+  }
+
+  /**
+   * Test that we don't generate classes twice
+   */
+  @Test
+  public void testRetrieveClass() throws Exception
+  {
+    Class<?> retrieved = ProxySubclassGenerator.getProxySubclass(TEST_CLASS);
+    assertNotNull("The new class was null", retrieved);
+    assertEquals("The same class was not returned", generatedProxySubclass, retrieved);
+
+  }
+
+  /**
+   * Test a private constructor
+   */
+  @Test
+  public void testPrivateConstructor() throws Exception
+  {
+    Object o = ProxySubclassGenerator.newProxySubclassInstance(
+        ProxyTestClassPrivateConstructor.class, ih);
+    assertNotNull("The new instance was null", o);
+
+  }
+  
+  /**
+   * Test object equality between real and proxy using a Collaborator
+   */
+  @Test
+  public void testObjectEquality() throws Exception
+  {
+    Object delegate = TEST_CLASS.newInstance();
+    InvocationHandler collaborator = new Collaborator(null, null, delegate);
+    Object o = ProxySubclassGenerator.newProxySubclassInstance(TEST_CLASS, collaborator);
+    //Calling equals on the proxy with an arg of the unwrapped object should be true
+    assertTrue("The proxy object should be equal to its delegate",o.equals(delegate));
+    InvocationHandler collaborator2 = new Collaborator(null, null, delegate);
+    Object o2 = ProxySubclassGenerator.newProxySubclassInstance(TEST_CLASS, collaborator2);
+    //The proxy of a delegate should equal another proxy of the same delegate
+    assertTrue("The proxy object should be equal to another proxy instance of the same delegate", o2.equals(o));
+  }
+  
+
+  private Class<?> getGeneratedSubclass() throws Exception
+  {
+    return ProxySubclassGenerator.getProxySubclass(TEST_CLASS);
+  }
+
+  private Object getSubclassInstance(Class<?> clazz) throws Exception
+  {
+    return clazz.getConstructor(InvocationHandler.class).newInstance(ih);
+  }
+
+  private class FakeInvocationHandler implements InvocationHandler
+  {
+    private Object delegate = null;
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object,
+     * java.lang.reflect.Method, java.lang.Object[])
+     */
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+    {
+      Object result = method.invoke(delegate, args);
+      return result;
+    }
+
+    void setDelegate(Object delegate){
+      this.delegate = delegate;
+    }
+    
+  }
+}

Added: incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassCovariant.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassCovariant.java?rev=897881&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassCovariant.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassCovariant.java Mon Jan 11 14:37:45 2010
@@ -0,0 +1,30 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+public class ProxyTestClassCovariant
+{
+
+  //this method is here to make sure we don't break on covariant override
+  public ProxyTestClassCovariant getCovariant()
+  {
+    return this;
+  }
+
+}

Added: incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassCovariantOverride.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassCovariantOverride.java?rev=897881&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassCovariantOverride.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassCovariantOverride.java Mon Jan 11 14:37:45 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+public class ProxyTestClassCovariantOverride extends ProxyTestClassCovariant
+{
+  //this method is here to make sure we don't break on covariant override
+  public ProxyTestClassCovariantOverride getCovariant()
+  {
+    return this;
+  }
+
+}

Added: incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassFinal.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassFinal.java?rev=897881&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassFinal.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassFinal.java Mon Jan 11 14:37:45 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+public final class ProxyTestClassFinal
+{
+
+  void someMethod()
+  {
+
+  }
+
+}

Added: incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassFinalMethod.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassFinalMethod.java?rev=897881&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassFinalMethod.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassFinalMethod.java Mon Jan 11 14:37:45 2010
@@ -0,0 +1,27 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+public class ProxyTestClassFinalMethod
+{
+  public final void someFinalMethod()
+  {
+
+  }
+}

Added: incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGeneral.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGeneral.java?rev=897881&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGeneral.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGeneral.java Mon Jan 11 14:37:45 2010
@@ -0,0 +1,54 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+public class ProxyTestClassGeneral extends ProxyTestClassSuper
+{
+
+  public String testMethod(String x, int y, Object z)
+  {
+    somePrivateMethod();
+    return x;
+  }
+
+  public String testArgs(double a, short b, long c, char d, byte e, boolean f)
+  {
+    return Character.toString(d);
+  }
+
+  protected void testReturnVoid()
+  {
+  }
+
+  int testReturnInt()
+  {
+    return 17;
+  }
+
+  public Integer testReturnInteger()
+  {
+    return Integer.valueOf(1);
+  }
+
+  private void somePrivateMethod()
+  {
+
+  }
+
+}

Added: incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGeneric.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGeneric.java?rev=897881&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGeneric.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGeneric.java Mon Jan 11 14:37:45 2010
@@ -0,0 +1,28 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+public class ProxyTestClassGeneric extends ProxyTestClassGenericSuper<String>
+{
+
+  public void setSomething(String s)
+  {
+    super.setSomething(s);
+  }
+}

Added: incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGenericSuper.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGenericSuper.java?rev=897881&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGenericSuper.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassGenericSuper.java Mon Jan 11 14:37:45 2010
@@ -0,0 +1,35 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+public class ProxyTestClassGenericSuper<T>
+{
+
+  T something = null;
+
+  public void setSomething(T something)
+  {
+    this.something = something;
+  }
+
+  public T getSomething()
+  {
+    return something;
+  }
+}

Added: incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassPrivateConstructor.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassPrivateConstructor.java?rev=897881&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassPrivateConstructor.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassPrivateConstructor.java Mon Jan 11 14:37:45 2010
@@ -0,0 +1,27 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+public class ProxyTestClassPrivateConstructor
+{
+  private ProxyTestClassPrivateConstructor()
+  {
+
+  }
+}

Added: incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassSuper.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassSuper.java?rev=897881&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassSuper.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/proxy/ProxyTestClassSuper.java Mon Jan 11 14:37:45 2010
@@ -0,0 +1,44 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+public class ProxyTestClassSuper
+{
+
+  public void bMethod()
+  {
+    aPrivateMethod();
+  }
+
+  protected void bProMethod()
+  {
+
+  }
+
+  void bDefMethod()
+  {
+
+  }
+
+  private void aPrivateMethod()
+  {
+
+  }
+
+}