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 2009/01/15 11:50:20 UTC
svn commit: r734662 - in /felix/trunk/ipojo:
core/src/main/java/org/apache/felix/ipojo/util/
tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/
tests/integration-tests/
Author: clement
Date: Thu Jan 15 02:50:19 2009
New Revision: 734662
URL: http://svn.apache.org/viewvc?rev=734662&view=rev
Log:
Update Property.java. The TYPE[].class construction is not supported by Apache Harmony. So, an empty array has to be created and the .getClass() method called.
Modified:
felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java
felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java
felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
felix/trunk/ipojo/tests/integration-tests/pom.xml
Modified: felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java?rev=734662&r1=734661&r2=734662&view=diff
==============================================================================
--- felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java (original)
+++ felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java Thu Jan 15 02:50:19 2009
@@ -181,33 +181,35 @@
* @throws ConfigurationException if the class cannot be loaded
*/
private static Class computeArrayType(String type, BundleContext context) throws ConfigurationException {
+ // Note: Harmony does't support the type[].class notation.
+ // An empty array has to be created to get the class object.
String internalType = type.substring(0, type.length() - 2);
if ("string".equals(internalType) || "String".equals(internalType)) {
- return String[].class;
+ return new String[0].getClass();
}
if ("boolean".equals(internalType)) {
- return boolean[].class;
+ return new boolean[0].getClass();
}
if ("byte".equals(internalType)) {
- return byte[].class;
+ return new byte[0].getClass();
}
if ("short".equals(internalType)) {
- return short[].class;
+ return new short[0].getClass();
}
if ("int".equals(internalType)) {
- return int[].class;
+ return new int[0].getClass();
}
if ("long".equals(internalType)) {
- return long[].class;
+ return new long[0].getClass();
}
if ("float".equals(internalType)) {
- return float[].class;
+ return new float[0].getClass();
}
if ("double".equals(internalType)) {
- return double[].class;
+ return new double[0].getClass();
}
if ("char".equals(internalType)) {
- return char[].class;
+ return new char[0].getClass();
}
// Complex array type.
Modified: felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java?rev=734662&r1=734661&r2=734662&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java (original)
+++ felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java Thu Jan 15 02:50:19 2009
@@ -32,7 +32,7 @@
ots.addTestSuite(ConfigAdminTest.class);
ots.addTestSuite(ObedienceTest.class);
ots.addTestSuite(FactoryProps.class);
- // ots.addTestSuite(EmptyArrayTest.class);
+ // ots.addTestSuite(EmptyArrayTest.class);
return ots;
}
Modified: felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java?rev=734662&r1=734661&r2=734662&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java (original)
+++ felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java Thu Jan 15 02:50:19 2009
@@ -47,7 +47,10 @@
try {
ci = f.createComponentInstance(p);
ci.dispose();
- } catch(Exception e) { fail("an acceptable configuration is refused : " + e.getMessage()); }
+ } catch(Exception e) {
+ fail("an acceptable configuration is refused : " + e.getMessage());
+ e.printStackTrace();
+ }
}
Modified: felix/trunk/ipojo/tests/integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/integration-tests/pom.xml?rev=734662&r1=734661&r2=734662&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/integration-tests/pom.xml (original)
+++ felix/trunk/ipojo/tests/integration-tests/pom.xml Thu Jan 15 02:50:19 2009
@@ -219,6 +219,7 @@
</dependency>
<!-- External handlers -->
+
<dependency>
<groupId>ipojo.tests</groupId>
<artifactId>tests.eventadmin.handler
@@ -242,7 +243,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.configadmin</artifactId>
- <version>1.0.4</version>
+ <version>1.0.8</version>
<scope>test</scope>
</dependency>
<dependency>