Initial attempt to reproduce FELIX-4347
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1549035 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java b/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java
index 998b598..e98f457 100644
--- a/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java
+++ b/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java
@@ -25,6 +25,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+import java.util.concurrent.Callable;
public class InnerClasses implements CheckService {
@@ -54,6 +55,12 @@
return true;
}
+ private static final Callable<Integer> callable = new Callable<Integer>() {
+ public Integer call() {
+ return 1;
+ }
+ };
+
public Properties getProps() {
Properties props = new Properties();
props.put("publicInner", new PublicNested().doSomething());
@@ -63,7 +70,12 @@
props.put("constructorInner", new ConstructorNested().doSomething());
props.put("staticInner", new StaticNested().doSomething());
props.put("packageStaticInner", new PackageStaticNested().doSomething());
-
+ try {
+ props.put("call", callable.call());
+ } catch (Exception e) {
+ // Ignore.
+ }
+
Job anonymous = new Job() {
public Map doSomething() {
Map map = new HashMap();
diff --git a/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java b/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java
index e8a0fa4..37d2774 100644
--- a/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java
+++ b/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java
@@ -167,6 +167,11 @@
}
@Test
+ public void testAnonymousClassDeclaredInStaticField() {
+ assertEquals(service.getProps().get("call"), 1);
+ }
+
+ @Test
public void testPackageStaticInnerClass() {
Map data = (Map) service.getProps().get("packageStaticInner");
assertNotNull("Check data existence", data);
@@ -212,9 +217,9 @@
assertEquals("Check private int", new Integer(3), data.get("privateInt"));
assertEquals("Check non-managed object", "not-managed", data.get("nonObject"));
assertEquals("Check non-managed int", new Integer(5), data.get("nonInt"));
-
}
+
@Override
protected List<String> getExtraExports() {
return Arrays.asList("org.apache.felix.ipojo.runtime.core.components");