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 2008/10/23 15:14:28 UTC

svn commit: r707369 - in /felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi: OSGiTestCase.java helpers/IPOJOHelper.java

Author: clement
Date: Thu Oct 23 06:14:28 2008
New Revision: 707369

URL: http://svn.apache.org/viewvc?rev=707369&view=rev
Log:
Remove dependencies on Java 5. The junit4osgi framework is now compatible with J2ME Foundation Profile 1.1

Modified:
    felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestCase.java
    felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/helpers/IPOJOHelper.java

Modified: felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestCase.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestCase.java?rev=707369&r1=707368&r2=707369&view=diff
==============================================================================
--- felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestCase.java (original)
+++ felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestCase.java Thu Oct 23 06:14:28 2008
@@ -150,7 +150,7 @@
 	 */
 	public static void assertEquals(String message, double expected,
 			double actual) {
-		if (Double.compare(expected, actual) != 0) {
+		if (expected != actual) {
 			fail(formatEqualsMessage(message, new Double(expected), new Double(
 					actual)));
 		}
@@ -420,7 +420,7 @@
 			refs = bundle.getBundleContext().getServiceReferences(itf, filter);
 		} catch (InvalidSyntaxException e) {
 			throw new IllegalArgumentException(
-					"Cannot get service references.", e);
+					"Cannot get service references: " + e.getMessage());
 		}
 		if (refs == null) {
 			return new ServiceReference[0];

Modified: felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/helpers/IPOJOHelper.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/helpers/IPOJOHelper.java?rev=707369&r1=707368&r2=707369&view=diff
==============================================================================
--- felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/helpers/IPOJOHelper.java (original)
+++ felix/trunk/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/helpers/IPOJOHelper.java Thu Oct 23 06:14:28 2008
@@ -100,8 +100,8 @@
             return fact.createComponentInstance(configuration);
         } catch (Exception e) {
             throw new IllegalArgumentException(
-                    "Cannot create the component instance with the given configuration.",
-                    e);
+                    "Cannot create the component instance with the given configuration:" +
+                    e.getMessage());
         }
     }
 
@@ -187,8 +187,8 @@
             return fact.createComponentInstance(configuration);
         } catch (Exception e) {
             throw new IllegalArgumentException(
-                    "Cannot create the component instance with the given configuration.",
-                    e);
+                    "Cannot create the component instance with the given configuration: " +
+                    e.getMessage());
         }
     }
 
@@ -335,7 +335,7 @@
 
         } catch (InvalidSyntaxException e) {
             throw new IllegalArgumentException(
-                    "Cannot get the component factory services.", e);
+                    "Cannot get the component factory services: " + e.getMessage());
         }
     }
 
@@ -398,7 +398,7 @@
             return null;
         } catch (InvalidSyntaxException e) {
             throw new IllegalArgumentException(
-                    "Cannot get the handler factory services.", e);
+                    "Cannot get the handler factory services: " + e.getMessage());
         }
     }
 
@@ -446,7 +446,7 @@
         } catch (ParseException e) {
             throw new IllegalStateException(
                     "Cannot parse the components from specified bundle ("
-                            + bundle.getSymbolicName() + ").", e);
+                            + bundle.getSymbolicName() + "): " + e.getMessage());
         }
     }
     
@@ -584,7 +584,7 @@
             refs = serviceContext.getServiceReferences(itf, filter);
         } catch (InvalidSyntaxException e) {
             throw new IllegalArgumentException(
-                    "Cannot get service references.", e);
+                    "Cannot get service references: " + e.getMessage());
         }
         if (refs == null) {
             return new ServiceReference[0];