felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1453923 - in /felix/trunk/ipojo: manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/...
Date Thu, 07 Mar 2013 15:44:22 GMT
Author: clement
Date: Thu Mar  7 15:44:21 2013
New Revision: 1453923

URL: http://svn.apache.org/r1453923
Log:
continuing FELIX-3903

Fix test on java 7.
Try to reproduce tests about enumeration.

Added:
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/Switches.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Color.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Job.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestSwitches.java
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/switches/
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/switches/TestSwitches.java
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/Color.java
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/Switches.java
Modified:
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/resources/metadata.xml
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPrimitiveTypes.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPrimitiveTypesWithNumberInNames.java
    felix/trunk/ipojo/manipulator/manipulator/pom.xml
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ManipulatedClassLoader.java
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ManipulatorTest.java
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/PojoWithInner.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestBothProperties.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-optional-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/di/TestDelayedOptionalDependencies.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-policies/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/policies/TestStaticMultipleDependencies.java

Modified: felix/trunk/ipojo/manipulator/manipulator-it/src/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/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java
(original)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/InnerClasses.java
Thu Mar  7 15:44:21 2013
@@ -1,6 +1,7 @@
 package org.apache.felix.ipojo.runtime.core.components;
 
 import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.Job;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -37,6 +38,7 @@ public class InnerClasses implements Che
         props.put("privateInner", new PrivateNested().doSomething());
         props.put("constructorInner", new ConstructorNested().doSomething());
         props.put("staticInner", new StaticNested().doSomething());
+        props.put("packageStaticInner", new PackageStaticNested().doSomething());
         
         Job anonymous = new Job()  {
             public Map doSomething() {
@@ -139,6 +141,16 @@ public class InnerClasses implements Che
             return map;
         }
     }
+
+    static class PackageStaticNested implements Job {
+        private Map map = new HashMap();
+
+        public Map doSomething() {
+            map.put("static", new Boolean(true));
+            map.put("staticint", new Integer(staticint));
+            return map;
+        }
+    }
     
     protected class ConstructorNested implements Job {
         Map map = new HashMap();
@@ -163,6 +175,3 @@ public class InnerClasses implements Che
 
 }
 
-interface Job {
-    public Map doSomething();
-}

Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/Switches.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/Switches.java?rev=1453923&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/Switches.java
(added)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/Switches.java
Thu Mar  7 15:44:21 2013
@@ -0,0 +1,69 @@
+package org.apache.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.Color;
+
+import java.util.Properties;
+
+/**
+ * A component checking switch construct with integer and enumeration.
+ */
+public class Switches implements CheckService {
+
+    private static enum Stuff {
+        FOO,
+        BAR
+    }
+
+    private String switchOnInteger(int i) {
+        switch (i) {
+            case 0:
+                return "0";
+            case 1:
+                return "1";
+            case 2:
+                return "2";
+            default:
+                return "3";
+        }
+    }
+
+    private String switchOnEnum(Color color) {
+        switch (color) {
+            case RED:
+                return "RED";
+            case GREEN:
+                return "GREEN";
+            case BLUE:
+                return "BLUE";
+            default:
+                return "COLOR";
+        }
+    }
+
+    private String switchOnStuff(Stuff stuff) {
+        switch (stuff) {
+            case FOO : return "foo";
+            case BAR : return "bar";
+            default: return "";
+        }
+    }
+
+    @Override
+    public boolean check() {
+        return true;
+    }
+
+    @Override
+    public Properties getProps() {
+        Properties properties = new Properties();
+        properties.put("switchOnInteger1", switchOnInteger(1));
+        properties.put("switchOnInteger4", switchOnInteger(4));
+
+        properties.put("switchOnEnumRed", switchOnEnum(Color.RED));
+
+        properties.put("switchOnStuffFoo", switchOnStuff(Stuff.FOO));
+
+        return properties;
+    }
+}

Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Color.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Color.java?rev=1453923&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Color.java
(added)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Color.java
Thu Mar  7 15:44:21 2013
@@ -0,0 +1,11 @@
+package org.apache.felix.ipojo.runtime.core.services;
+
+/**
+ * An enumeration.
+ */
+public enum Color {
+
+    RED,
+    GREEN,
+    BLUE
+}

Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Job.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Job.java?rev=1453923&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Job.java
(added)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Job.java
Thu Mar  7 15:44:21 2013
@@ -0,0 +1,10 @@
+package org.apache.felix.ipojo.runtime.core.services;
+
+import java.util.Map;
+
+/**
+ *
+ */
+public interface Job {
+    public Map doSomething();
+}

Modified: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/resources/metadata.xml?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/resources/metadata.xml
(original)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/resources/metadata.xml
Thu Mar  7 15:44:21 2013
@@ -34,4 +34,8 @@
 			<property field="publicInt"/>
 		</provides>
 	</component>
+
+    <component classname="org.apache.felix.ipojo.runtime.core.components.Switches">
+        <provides/>
+    </component>
 </ipojo>

Modified: felix/trunk/ipojo/manipulator/manipulator-it/src/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/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java
(original)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNestedClasses.java
Thu Mar  7 15:44:21 2013
@@ -145,6 +145,16 @@ public class TestNestedClasses extends C
     }
 
     @Test
+    public void testPackageStaticInnerClass() {
+        Map data = (Map) service.getProps().get("packageStaticInner");
+        assertNotNull("Check data existence", data);
+
+        assertEquals("Check static", new Boolean(true), data.get("static"));
+        assertEquals("Check static int", new Integer(6), data.get("staticint"));
+
+    }
+
+    @Test
     public void testAnonymousInnerClass() {
         Map data = (Map) service.getProps().get("anonymous");
         assertNotNull("Check data existence", data);

Modified: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPrimitiveTypes.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPrimitiveTypes.java?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPrimitiveTypes.java
(original)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPrimitiveTypes.java
Thu Mar  7 15:44:21 2013
@@ -77,16 +77,16 @@ public class TestPrimitiveTypes extends 
 
     @Test
     public void testFloat() {
-        assertEquals("Check - 1", prim.getFloat(), 1.1f);
+        assertEquals("Check - 1", prim.getFloat(), 1.1f, 0);
         prim.setFloat(2.2f);
-        assertEquals("Check - 2", prim.getFloat(), 2.2f);
+        assertEquals("Check - 2", prim.getFloat(), 2.2f, 0);
     }
 
     @Test
     public void testDouble() {
-        assertEquals("Check - 1", prim.getDouble(), 1.1);
+        assertEquals("Check - 1", prim.getDouble(), 1.1, 0);
         prim.setDouble(2.2);
-        assertEquals("Check - 2", prim.getDouble(), 2.2);
+        assertEquals("Check - 2", prim.getDouble(), 2.2, 0);
     }
 
     @Test

Modified: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPrimitiveTypesWithNumberInNames.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPrimitiveTypesWithNumberInNames.java?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPrimitiveTypesWithNumberInNames.java
(original)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPrimitiveTypesWithNumberInNames.java
Thu Mar  7 15:44:21 2013
@@ -82,16 +82,16 @@ public class TestPrimitiveTypesWithNumbe
 
     @Test
     public void testFloat() {
-        assertEquals("Check - 1", prim.getFloat(), 1.1f);
+        assertEquals("Check - 1", prim.getFloat(), 1.1f, 0);
         prim.setFloat(2.2f);
-        assertEquals("Check - 2", prim.getFloat(), 2.2f);
+        assertEquals("Check - 2", prim.getFloat(), 2.2f, 0);
     }
 
     @Test
     public void testDouble() {
-        assertEquals("Check - 1", prim.getDouble(), 1.1);
+        assertEquals("Check - 1", prim.getDouble(), 1.1, 0);
         prim.setDouble(2.2);
-        assertEquals("Check - 2", prim.getDouble(), 2.2);
+        assertEquals("Check - 2", prim.getDouble(), 2.2, 0);
     }
 
     @Test

Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestSwitches.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestSwitches.java?rev=1453923&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestSwitches.java
(added)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestSwitches.java
Thu Mar  7 15:44:21 2013
@@ -0,0 +1,60 @@
+package org.apache.felix.ipojo.runtime.core;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.ops4j.pax.exam.ProbeBuilder;
+import org.ops4j.pax.exam.TestProbeBuilder;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class TestSwitches extends Common {
+
+    private ComponentInstance instance;
+    private CheckService service;
+
+    @Before
+    public void setUp() {
+        instance = ipojoHelper.createComponentInstance("org.apache.felix.ipojo.runtime.core.components.Switches");
+
+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(),
instance.getInstanceName());
+        assertNotNull("Check service availability", ref);
+        service = (CheckService) osgiHelper.getServiceObject(ref);
+    }
+
+    @After
+    public void tearDown() {
+        service = null;
+    }
+
+    @ProbeBuilder
+    public TestProbeBuilder probe(TestProbeBuilder builder) {
+        builder.setHeader(Constants.IMPORT_PACKAGE, "org.osgi.framework, org.apache.felix.ipojo,
" +
+                "org.ow2.chameleon.testing.helpers," +
+                "org.apache.felix.ipojo.architecture, org.apache.felix.ipojo.handlers.dependency,"
+
+                "org.apache.felix.ipojo.runtime.core.services, org.apache.felix.ipojo.runtime.core.components");
+        builder.setHeader(Constants.DYNAMICIMPORT_PACKAGE, "org.ops4j.pax.exam,org.junit,javax.inject,"
+
+                "org.ops4j.pax.exam.options,junit.framework");
+        builder.setHeader("Bundle-ManifestVersion", "2");
+        return builder;
+    }
+
+    @Test
+    public void testSwitches() {
+        Properties properties = service.getProps();
+        assertEquals(properties.get("switchOnInteger1"), "1");
+        assertEquals(properties.get("switchOnInteger4"), "3");
+
+
+        assertEquals(properties.get("switchOnEnumRed"), "RED");
+    }
+
+
+}

Modified: felix/trunk/ipojo/manipulator/manipulator/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/pom.xml?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/pom.xml (original)
+++ felix/trunk/ipojo/manipulator/manipulator/pom.xml Thu Mar  7 15:44:21 2013
@@ -61,6 +61,12 @@
           <version>4.2.0</version>
           <scope>test</scope>
       </dependency>
+      <dependency>
+          <groupId>commons-io</groupId>
+          <artifactId>commons-io</artifactId>
+          <version>2.4</version>
+          <scope>test</scope>
+      </dependency>
     </dependencies>
     <build>
         <plugins>

Modified: felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ManipulatedClassLoader.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ManipulatedClassLoader.java?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ManipulatedClassLoader.java
(original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ManipulatedClassLoader.java
Thu Mar  7 15:44:21 2013
@@ -18,27 +18,44 @@
  */
 package org.apache.felix.ipojo.manipulation;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * A classloader used to load manipulated classes.
  */
-class ManipulatedClassLoader extends ClassLoader {
+public class ManipulatedClassLoader extends ClassLoader {
 
     private String name;
     private byte[] clazz;
 
+    private Map<String, byte[]> inners = new HashMap<String, byte[]>();
+
     public ManipulatedClassLoader(String name, byte[] clazz) {
         this.name = name;
         this.clazz = clazz;
     }
 
+    public void addInnerClasses(Map<String, byte[]> inn) {
+        inners = inn;
+    }
+
     public Class findClass(String name) throws ClassNotFoundException {
         if (name.equals(this.name)) {
             return defineClass(name, clazz, 0, clazz.length);
         }
+        if (inners.containsKey(name)) {
+            return defineClass(name, inners.get(name), 0, inners.get(name).length);
+
+        }
         return super.findClass(name);
     }
 
     public Class loadClass(String arg0) throws ClassNotFoundException {
+        if (inners.containsKey(arg0)) {
+            return defineClass(arg0, inners.get(arg0), 0, inners.get(arg0).length);
+
+        }
         return super.loadClass(arg0);
     }
 }

Modified: felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ManipulatorTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ManipulatorTest.java?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ManipulatorTest.java
(original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ManipulatorTest.java
Thu Mar  7 15:44:21 2013
@@ -195,8 +195,7 @@ public class ManipulatorTest extends Tes
 
     }
 
-    //TODO CE - 19/10/2011 Why do we have a classloader issue in this test
-    public void _testManipulatingTheInner() throws Exception {
+    public void testManipulatingTheInner() throws Exception {
         Manipulator manipulator = new Manipulator();
         byte[] clazz = manipulator.manipulate(getBytesFromFile(new File("target/test-classes/test/PojoWithInner.class")));
         ManipulatedClassLoader classloader = new ManipulatedClassLoader("test.PojoWithInner",
clazz);

Added: felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/switches/TestSwitches.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/switches/TestSwitches.java?rev=1453923&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/switches/TestSwitches.java
(added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/switches/TestSwitches.java
Thu Mar  7 15:44:21 2013
@@ -0,0 +1,99 @@
+package org.apache.felix.ipojo.manipulation.switches;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.felix.ipojo.manipulation.ManipulatedClassLoader;
+import org.apache.felix.ipojo.manipulation.Manipulator;
+import org.junit.Assert;
+import org.junit.Test;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.util.CheckClassAdapter;
+import test.switches.Color;
+
+import java.io.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Checks the manipulation of switch constructs
+ */
+public class TestSwitches {
+
+
+    @Test
+    public void testSwitchOnInteger() throws IOException, ClassNotFoundException, IllegalAccessException,
InstantiationException, NoSuchMethodException, InvocationTargetException {
+        Manipulator manipulator = new Manipulator();
+        byte[] clazz = manipulator.manipulate(getBytesFromFile(new File
+                ("target/test-classes/test/switches/Switches.class")));
+        ManipulatedClassLoader classloader = new ManipulatedClassLoader("test.switches.Switches",
clazz);
+
+        ClassReader reader = new ClassReader(clazz);
+        CheckClassAdapter.verify(reader, false, new PrintWriter(new File("/tmp/class_dump")));
+
+        Class cl = classloader.findClass("test.switches.Switches");
+        Object o = cl.newInstance();
+
+        Method method = cl.getMethod("switchOnInteger", new Class[] { Integer.TYPE});
+        int zero = (Integer) method.invoke(o, 0);
+        int one = (Integer) method.invoke(o, 1);
+        int two = (Integer) method.invoke(o, 2);
+        int three = (Integer) method.invoke(o, 4);
+
+        Assert.assertEquals(zero, 0);
+        Assert.assertEquals(one, 1);
+        Assert.assertEquals(two, 2);
+        Assert.assertEquals(three, 3);
+    }
+
+    @Test
+    public void testSwitchOnEnum() throws IOException, ClassNotFoundException, IllegalAccessException,
+            InstantiationException, NoSuchMethodException, InvocationTargetException {
+        Manipulator manipulator = new Manipulator();
+        byte[] clazz = manipulator.manipulate(getBytesFromFile(new File
+                ("target/test-classes/test/switches/Switches.class")));
+        ManipulatedClassLoader classloader = new ManipulatedClassLoader("test.switches.Switches",
clazz);
+        Map<String, byte[]> inners = new HashMap<String, byte[]>();
+
+        inners.put("test.switches.Switches$1", getBytesFromFile(new File
+                ("target/test-classes/test/switches/Switches$1.class")));
+        classloader.addInnerClasses(inners);
+
+        FileUtils.writeByteArrayToFile(new File("target/Switches.class"), clazz);
+
+        Class cl = classloader.findClass("test.switches.Switches");
+        Object o = cl.newInstance();
+
+        Method method = cl.getMethod("switchOnEnum", new Class[] { Color.class});
+        int one = (Integer) method.invoke(o, Color.RED);
+        int two = (Integer) method.invoke(o, Color.GREEN);
+        int three = (Integer) method.invoke(o, Color.BLUE);
+
+        Assert.assertEquals(one, 1);
+        Assert.assertEquals(two, 2);
+        Assert.assertEquals(three, 3);
+    }
+
+    public static byte[] getBytesFromFile(File file) throws IOException {
+        InputStream is = new FileInputStream(file);
+        long length = file.length();
+        byte[] bytes = new byte[(int)length];
+
+        // Read in the bytes
+        int offset = 0;
+        int numRead = 0;
+        while (offset < bytes.length
+                && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0)
{
+            offset += numRead;
+        }
+
+        // Ensure all the bytes have been read in
+        if (offset < bytes.length) {
+            throw new IOException("Could not completely read file "+file.getName());
+        }
+
+        // Close the input stream and return bytes
+        is.close();
+        return bytes;
+    }
+}

Modified: felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/PojoWithInner.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/PojoWithInner.java?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/PojoWithInner.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/PojoWithInner.java Thu Mar
 7 15:44:21 2013
@@ -25,9 +25,14 @@ public class PojoWithInner {
 	// This is a simple POJO
 
 	public boolean doSomething() {
+        System.out.println(new MySecondInner().i);
 		return m_result.getInner();
 	}
 
+    class MySecondInner {
+        int i = 0;
+    }
+
 	public class MyInner {
 
 		public boolean getInner() {

Added: felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/Color.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/Color.java?rev=1453923&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/Color.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/Color.java Thu Mar
 7 15:44:21 2013
@@ -0,0 +1,8 @@
+package test.switches;
+
+/**
+ * An enum.
+ */
+public enum Color {
+    RED, GREEN, BLUE
+}

Added: felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/Switches.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/Switches.java?rev=1453923&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/Switches.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/switches/Switches.java Thu
Mar  7 15:44:21 2013
@@ -0,0 +1,25 @@
+package test.switches;
+
+/**
+ * A component using switch on integers and enum.
+ */
+public class Switches {
+
+
+    public int switchOnInteger(int i) {
+        switch (i) {
+            case 0 : return 0;
+            case 1 : return 1;
+            case 2 : return 2;
+            default: return 3;
+        }
+    }
+
+    public int switchOnEnum(Color c) {
+        switch (c) {
+            case RED: return 1;
+            case GREEN: return 2;
+            default: return 3;
+        }
+    }
+}

Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestBothProperties.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestBothProperties.java?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestBothProperties.java
(original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestBothProperties.java
Thu Mar  7 15:44:21 2013
@@ -102,8 +102,8 @@ public class TestBothProperties extends 
         assertEquals("Check s", s, new Short("1"));
         assertEquals("Check i", i, new Integer("1"));
         assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
+        assertEquals("Check d", d, new Double("1"), 0);
+        assertEquals("Check f", f, new Float("1"), 0);
         assertEquals("Check c", c, new Character('a'));
         assertEquals("Check bool", bool, new Boolean("true"));
 
@@ -145,8 +145,8 @@ public class TestBothProperties extends 
         assertEquals("2) Check s", s, new Short("2"));
         assertEquals("2) Check i", i, new Integer("2"));
         assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
+        assertEquals("2) Check d", d, new Double("2"), 0);
+        assertEquals("2) Check f", f, new Float("2"), 0);
         assertEquals("2) Check c", c, new Character('b'));
         assertEquals("2) Check bool", bool, new Boolean("false"));
 
@@ -190,8 +190,8 @@ public class TestBothProperties extends 
         assertEquals("Check s", s, new Short("1"));
         assertEquals("Check i", i, new Integer("1"));
         assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
+        assertEquals("Check d", d, new Double("1"), 0);
+        assertEquals("Check f", f, new Float("1"), 0);
         assertEquals("Check c", c, new Character('a'));
         assertEquals("Check bool", bool, new Boolean("true"));
 
@@ -233,8 +233,8 @@ public class TestBothProperties extends 
         assertEquals("2) Check s", s, new Short("2"));
         assertEquals("2) Check i", i, new Integer("2"));
         assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
+        assertEquals("2) Check d", d, new Double("2"), 0);
+        assertEquals("2) Check f", f, new Float("2"), 0);
         assertEquals("2) Check c", c, new Character('b'));
         assertEquals("2) Check bool", bool, new Boolean("false"));
 
@@ -286,9 +286,9 @@ public class TestBothProperties extends 
         assertEquals("Check l 0", l[0], 1);
         assertEquals("Check l 1", l[1], 2);
         assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1.0);
-        assertEquals("Check d 1", d[1], 2.0);
-        assertEquals("Check d 2", d[2], 3.0);
+        assertEquals("Check d 0", d[0], 1.0, 0);
+        assertEquals("Check d 1", d[1], 2.0, 0);
+        assertEquals("Check d 2", d[2], 3.0, 0);
         assertEquals("Check f 0", f[0], 1.0, 0);
         assertEquals("Check f 1", f[1], 2.0, 0);
         assertEquals("Check f 2", f[2], 3.0, 0);
@@ -345,9 +345,9 @@ public class TestBothProperties extends 
         assertEquals("2) Check l 0", l[0], 3);
         assertEquals("2) Check l 1", l[1], 2);
         assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3.0);
-        assertEquals("2) Check d 1", d[1], 2.0);
-        assertEquals("2) Check d 2", d[2], 1.0);
+        assertEquals("2) Check d 0", d[0], 3.0, 0);
+        assertEquals("2) Check d 1", d[1], 2.0, 0);
+        assertEquals("2) Check d 2", d[2], 1.0, 0);
         assertEquals("2) Check f 0", f[0], 3.0, 0);
         assertEquals("2) Check f 1", f[1], 2.0, 0);
         assertEquals("2) Check f 2", f[2], 1.0, 0);
@@ -406,9 +406,9 @@ public class TestBothProperties extends 
         assertEquals("Check l 0", l[0], 1);
         assertEquals("Check l 1", l[1], 2);
         assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1.0);
-        assertEquals("Check d 1", d[1], 2.0);
-        assertEquals("Check d 2", d[2], 3.0);
+        assertEquals("Check d 0", d[0], 1.0, 0);
+        assertEquals("Check d 1", d[1], 2.0, 0);
+        assertEquals("Check d 2", d[2], 3.0, 0);
         assertEquals("Check f 0", f[0], 1, 0);
         assertEquals("Check f 1", f[1], 2, 0);
         assertEquals("Check f 2", f[2], 3, 0);
@@ -465,9 +465,9 @@ public class TestBothProperties extends 
         assertEquals("2) Check l 0", l[0], 3);
         assertEquals("2) Check l 1", l[1], 2);
         assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3.0);
-        assertEquals("2) Check d 1", d[1], 2.0);
-        assertEquals("2) Check d 2", d[2], 1.0);
+        assertEquals("2) Check d 0", d[0], 3.0, 0);
+        assertEquals("2) Check d 1", d[1], 2.0, 0);
+        assertEquals("2) Check d 2", d[2], 1.0, 0);
         assertEquals("2) Check f 0", f[0], 3, 0);
         assertEquals("2) Check f 1", f[1], 2, 0);
         assertEquals("2) Check f 2", f[2], 1, 0);
@@ -652,8 +652,8 @@ public class TestBothProperties extends 
         assertEquals("Check s", s, new Short("0"));
         assertEquals("Check i", i, new Integer("0"));
         assertEquals("Check l", l, new Long("0"));
-        assertEquals("Check d", d, new Double("0"));
-        assertEquals("Check f", f, new Float("0"));
+        assertEquals("Check d", d, new Double("0"), 0);
+        assertEquals("Check f", f, new Float("0"), 0);
         assertEquals("Check c", c, new Character((char) 0));
         assertEquals("Check bool", bool, new Boolean(false));
 
@@ -695,8 +695,8 @@ public class TestBothProperties extends 
         assertEquals("2) Check s", s, new Short("2"));
         assertEquals("2) Check i", i, new Integer("2"));
         assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
+        assertEquals("2) Check d", d, new Double("2"), 0);
+        assertEquals("2) Check f", f, new Float("2"), 0);
         assertEquals("2) Check c", c, new Character('b'));
         assertEquals("2) Check bool", bool, new Boolean("false"));
 
@@ -791,9 +791,9 @@ public class TestBothProperties extends 
         assertEquals("2) Check l 0", l[0], 3);
         assertEquals("2) Check l 1", l[1], 2);
         assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3.0);
-        assertEquals("2) Check d 1", d[1], 2.0);
-        assertEquals("2) Check d 2", d[2], 1.0);
+        assertEquals("2) Check d 0", d[0], 3.0, 0);
+        assertEquals("2) Check d 1", d[1], 2.0, 0);
+        assertEquals("2) Check d 2", d[2], 1.0, 0);
         assertEquals("2) Check f 0", f[0], 3, 0);
         assertEquals("2) Check f 1", f[1], 2, 0);
         assertEquals("2) Check f 2", f[2], 1, 0);

Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-optional-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/di/TestDelayedOptionalDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-optional-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/di/TestDelayedOptionalDependencies.java?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-optional-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/di/TestDelayedOptionalDependencies.java
(original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-optional-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/di/TestDelayedOptionalDependencies.java
Thu Mar  7 15:44:21 2013
@@ -119,7 +119,7 @@ public class TestDelayedOptionalDependen
         assertNotNull("Check FS invocation (object) - 1", props.get("object"));
         assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(),
1);
         assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(),
1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0);
+        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0, 0);
 
         fooProvider.stop();
 
@@ -142,7 +142,7 @@ public class TestDelayedOptionalDependen
         assertNull("Check FS invocation (object) - 2", props.get("object"));
         assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(),
5);
         assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(),
5);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
5.0);
+        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
5.0, 0);
 
         id = null;
         cs = null;
@@ -177,7 +177,7 @@ public class TestDelayedOptionalDependen
         assertNotNull("Check FS invocation (object) - 1", props.get("object"));
         assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(),
1);
         assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(),
1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0);
+        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0, 0);
 
         fooProvider.stop();
 
@@ -200,7 +200,7 @@ public class TestDelayedOptionalDependen
         assertNull("Check FS invocation (object) - 2", props.get("object"));
         assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(),
5);
         assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(),
5);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
5.0);
+        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
5.0, 0);
 
         id = null;
         cs = null;

Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-policies/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/policies/TestStaticMultipleDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-policies/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/policies/TestStaticMultipleDependencies.java?rev=1453923&r1=1453922&r2=1453923&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-policies/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/policies/TestStaticMultipleDependencies.java
(original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-policies/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/policies/TestStaticMultipleDependencies.java
Thu Mar  7 15:44:21 2013
@@ -114,7 +114,7 @@ public class TestStaticMultipleDependenc
         assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(),
0);
         assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(),
1);
         assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(),
1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0);
+        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0, 0);
 
         fooProvider2.start();
         ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), instance1.getInstanceName());
@@ -133,7 +133,7 @@ public class TestStaticMultipleDependenc
         assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(),
0);
         assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(),
1);
         assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(),
1);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
1.0);
+        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
1.0, 0);
 
         fooProvider1.stop();
         // instance is stopped and then restarted, so bound to fooprovider 2.
@@ -173,7 +173,7 @@ public class TestStaticMultipleDependenc
         assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(),
0);
         assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(),
1);
         assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(),
1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0);
+        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0, 0);
 
         fooProvider2.start();
         id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
@@ -191,7 +191,7 @@ public class TestStaticMultipleDependenc
         assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(),
0);
         assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(),
1);
         assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(),
1);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
1.0);
+        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
1.0, 0);
 
         fooProvider1.stop();
 
@@ -231,7 +231,7 @@ public class TestStaticMultipleDependenc
         assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(),
0);
         assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(),
1);
         assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(),
1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0);
+        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0, 0);
 
         fooProvider2.start();
         id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
@@ -249,7 +249,7 @@ public class TestStaticMultipleDependenc
         assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(),
0);
         assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(),
1);
         assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(),
1);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
1.0);
+        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
1.0, 0);
 
         fooProvider1.stop();
         // Instance stopped and then restarted, bound to foo provider 2.
@@ -289,7 +289,7 @@ public class TestStaticMultipleDependenc
         assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(),
0);
         assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(),
1);
         assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(),
1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0);
+        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(),
1.0, 0);
 
         fooProvider2.start();
         id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
@@ -307,7 +307,7 @@ public class TestStaticMultipleDependenc
         assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(),
0);
         assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(),
1);
         assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(),
1);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
1.0);
+        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(),
1.0, 0);
 
         fooProvider1.stop();
         // Stop and then restarted, bound to foo provider 2.



Mime
View raw message