You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2013/12/08 16:08:55 UTC
svn commit: r1549035 - in
/felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src:
main/java/org/apache/felix/ipojo/runtime/core/components/
test/java/org/apache/felix/ipojo/runtime/core/
Author: clement
Date: Sun Dec 8 15:08:55 2013
New Revision: 1549035
URL: http://svn.apache.org/r1549035
Log:
Initial attempt to reproduce FELIX-4347
Modified:
felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java
felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java
Modified: felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java?rev=1549035&r1=1549034&r2=1549035&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java Sun Dec 8 15:08:55 2013
@@ -25,6 +25,7 @@ import org.apache.felix.ipojo.runtime.co
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 @@ public class InnerClasses implements Che
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 @@ public class InnerClasses implements Che
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();
Modified: felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java?rev=1549035&r1=1549034&r2=1549035&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java Sun Dec 8 15:08:55 2013
@@ -167,6 +167,11 @@ public class TestNestedClasses extends B
}
@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 @@ public class TestNestedClasses extends B
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");