felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r631312 - in /felix/sandbox/clement/ipojo/tests: tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/ tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/provides/ tests.composite/src/main/resources/...
Date Tue, 26 Feb 2008 17:38:39 GMT
Author: clement
Date: Tue Feb 26 09:38:37 2008
New Revision: 631312

URL: http://svn.apache.org/viewvc?rev=631312&view=rev
Log:
Modify composite test according to syntax change
Add test on two-word types (long ...) in the manipulator.

Modified:
    felix/sandbox/clement/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
    felix/sandbox/clement/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java
    felix/sandbox/clement/ipojo/tests/tests.composite/src/main/resources/metadata.xml
    felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
    felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
    felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
    felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/PrimitiveManipulationTestService.java

Modified: felix/sandbox/clement/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java?rev=631312&r1=631311&r2=631312&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
(original)
+++ felix/sandbox/clement/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
Tue Feb 26 09:38:37 2008
@@ -54,7 +54,8 @@
 	}
 	
 	public void testSimple() {
-		import1.start(); 
+        import1.start();
+
 		//Two providers
 		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
 		ServiceContext sc = Utils.getServiceContext(import1);
@@ -69,8 +70,8 @@
 		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
 		sc = Utils.getServiceContext(import1);
 		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
+		assertNotNull("Test foo availability inside the composite - 2", refs);
+		assertEquals("Test foo availability inside the composite - 2.2", refs.length, 1);
 		fs = (FooService) sc.getService(refs[0]);
 		assertTrue("Test foo invocation", fs.foo());
 		sc.ungetService(refs[0]);

Modified: felix/sandbox/clement/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java?rev=631312&r1=631311&r2=631312&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java
(original)
+++ felix/sandbox/clement/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java
Tue Feb 26 09:38:37 2008
@@ -202,7 +202,7 @@
         tata5 = (Integer) props.get("tata5");
         tata5_1 = (Integer) props.get("tata5_1");
         tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 6", tata.intValue(), 1);
+        assertEquals("Assert tata - 6", 1, tata.intValue());
         assertEquals("Assert tataStr - 6", tataStr.intValue(), 1);
         assertEquals("Assert tataStrs - 6", tataStrs.intValue(), 0);
         assertEquals("Assert tata_2 - 6", tata_2.intValue(), 1);

Modified: felix/sandbox/clement/ipojo/tests/tests.composite/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.composite/src/main/resources/metadata.xml?rev=631312&r1=631311&r2=631312&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.composite/src/main/resources/metadata.xml (original)
+++ felix/sandbox/clement/ipojo/tests/tests.composite/src/main/resources/metadata.xml Tue
Feb 26 09:38:37 2008
@@ -4,45 +4,45 @@
 	</composite>
 	
 	<composite name="composite.bar.1" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.BarService"/>
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BarService"/>
 	</composite>
 	
 	<composite name="composite.bar.2" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.BarService" aggregate="true"/>
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BarService"
aggregate="true"/>
 	</composite>
 	
 	<composite name="composite.bar.3" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.BarService" optional="true"/>
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BarService"
optional="true"/>
 	</composite>
 	
 	<composite name="composite.bar.4" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.FooService" aggregate="true"
optional="true"/>
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.FooService"
aggregate="true" optional="true"/>
 	</composite>
 	
 	<composite name="composite.bar.5-accept" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.FooService">
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.FooService">
 			<property name="boolean" value="true"/>
 			<property name="string" value="foo"/>
 			<property name="strAprop" value="{foo, bar, baz}"/>
 			<property name="int" value="5"/>
-		</service>
+		</subservice>
 	</composite>
 	
 	<composite name="composite.bar.5-refuse1" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.BarService">
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BarService">
 			<property name="foo" value="bar"/>
 			<property name="boolean" value="true"/>
 			<property name="string" value="foo"/>
 			<property name="strAprop" value="{foo, bar, baz}"/>
 			<property name="int" value="5"/>
-		</service>
+		</subservice>
 	</composite>
 	
 	<composite name="composite.bar.5-refuse2" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.BarService">
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BarService">
 			<property name="string" value="foo"/>
 			<property name="strAprop" value="{foo, bar, baz}"/>
-		</service>
+		</subservice>
 	</composite>
 	
 	<composite name="composite.inst.1" factory="true" architecture="true">
@@ -55,23 +55,23 @@
 	</composite>
 	
 	<composite name="composite.requires.1" architecture="true">
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.FooService" scope="composite"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.FooService"
scope="composite"/>
 	</composite>
 	
 	<composite name="composite.requires.2" architecture="true">
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.FooService" aggregate="true"
scope="composite"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.FooService"
aggregate="true" scope="composite"/>
 	</composite>
 	
 	<composite name="composite.requires.3" architecture="true">
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.FooService" optional="true"
scope="composite"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.FooService"
optional="true" scope="composite"/>
 	</composite>
 	
 	<composite name="composite.requires.4" architecture="true">
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.FooService" optional="true"
aggregate="true" scope="composite"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.FooService"
optional="true" aggregate="true" scope="composite"/>
 	</composite>
 	
 	<composite name="composite.requires.5" architecture="true">
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.FooService" filter="(&amp;(int=2)(long=40))"
scope="composite"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.FooService"
filter="(&amp;(int=2)(long=40))" scope="composite"/>
 	</composite>
 	
 	<component className="org.apache.felix.ipojo.test.composite.component.BazProviderType1"
factory="BazProviderType" scope="composite">
@@ -79,28 +79,28 @@
 	</component>
 	
 	<composite name="composite.export.1" architecture="true">
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true"
optional="true" filter="(!(instance.name=export))" scope="composite"/>
-		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
+		<provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
 	</composite>
 	
 	<composite name="composite.export.2" architecture="true">
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" scope="composite"
aggregate="true" optional="true" filter="(!(instance.name=export))"/>
-		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService" optional="true"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
scope="composite" aggregate="true" optional="true" filter="(!(instance.name=export))"/>
+		<provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
optional="true"/>
 	</composite>
 	
 	<composite name="composite.export.3" architecture="true">
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" scope="composite"
aggregate="true" optional="true" filter="(!(instance.name=export))"/>
-		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
scope="composite" aggregate="true" optional="true" filter="(!(instance.name=export))"/>
+		<provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
aggregate="true"/>
 	</composite>
 	
 	<composite name="composite.export.4" architecture="true">
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true"
optional="true" filter="(!(instance.name=export))" scope="composite"/>
-		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true"
optional="true"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
+		<provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
aggregate="true" optional="true"/>
 	</composite>
 	
 	<composite name="composite.export.5" architecture="true">
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true"
optional="true" filter="(!(instance.name=export))" scope="composite"/>
-		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService" filter="(instance.name=foo1)"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
+		<provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
filter="(instance.name=foo1)"/>
 	</composite>
 	
 	<component className="org.apache.felix.ipojo.test.composite.component.Baz2CheckProvider"
factory="Baz2CheckProvider" architecture="true">
@@ -109,27 +109,27 @@
 	</component>
 
 	<composite name="composite.test.3" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true"
filter="(factory.name=BazProviderType)"/>
-		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
aggregate="true" filter="(factory.name=BazProviderType)"/>
+		<provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
 	</composite>
 	
 	<composite name="composite.test.2" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"
filter="(factory.name=Baz2CheckProvider)"/>
-		<exports specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"/>
-		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" scope="composite"/>
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"
filter="(factory.name=Baz2CheckProvider)"/>
+		<provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
scope="composite"/>
 	</composite>
 	
 	<composite name="composite.test.1" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.BazService" filter="(factory.name=composite.test.3)"
/>
-		<service specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"
filter="(factory.name=composite.test.2)"/>
-		<exports specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"/>
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
filter="(factory.name=composite.test.3)" />
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"
filter="(factory.name=composite.test.2)"/>
+		<provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"/>
 	</composite>
 
 	<composite name="composite.instantiator" architecture="true">
-				<service specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
filter="(factory.name=composite.test.3)"/>
-				<service specification="org.apache.felix.ipojo.test.scenarios.service.FooService"/>
-				<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
-				<exports specification="org.apache.felix.ipojo.test.scenarios.service.FooService"/>
+				<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"
filter="(factory.name=composite.test.3)"/>
+				<subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.FooService"/>
+				<provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
+				<provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.FooService"/>
 	</composite>
 
 	<!-- Test composition provides -->
@@ -146,76 +146,76 @@
 	</component>
 	
 	<composite name="comp-0" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
-		<requires specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
-		<provides specification="org.apache.felix.ipojo.test.composite.service.Tota"/>
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
+		<provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota"/>
 	</composite>
 	
 	<composite name="comp-1" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
-		<requires specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
-		<provides specification="org.apache.felix.ipojo.test.composite.service.Tota">
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
+		<provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota">
 			<delegation method="tataInt" policy="One"/>
 			<delegation method="toto1" policy="All"/>
 		</provides>
 	</composite>
 
 	<composite name="comp-2" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.composite.service.Tata" aggregate="true"/>
-		<requires specification="org.apache.felix.ipojo.test.composite.service.Toto" aggregate="true"/>
-		<provides specification="org.apache.felix.ipojo.test.composite.service.Tota">
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"
aggregate="true"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"
aggregate="true"/>
+		<provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota">
 			<delegation method="tataInt" policy="One"/>
 			<delegation method="toto1" policy="All"/>
 		</provides>
 	</composite>	
 	
 	<composite name="comp-3" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
-		<requires specification="org.apache.felix.ipojo.test.composite.service.Toto" optional="true"/>
-		<provides specification="org.apache.felix.ipojo.test.composite.service.Tota">
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"
optional="true"/>
+		<provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota">
 		</provides>
 	</composite>
 	
 	<composite name="comp-4" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
-		<requires specification="org.apache.felix.ipojo.test.composite.service.Toto" optional="true"/>
-		<provides specification="org.apache.felix.ipojo.test.composite.service.Tota">
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"
optional="true"/>
+		<provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota">
 			<delegation method="tataInt" policy="One"/>
 			<delegation method="toto1" policy="All"/>
 		</provides>
 	</composite>		
 	
 	<composite name="comp-5" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.composite.service.Tata" aggregate="true"/>
-		<!-- <requires specification="org.apache.felix.ipojo.test.composite.service.Toto"
aggregate ="true" optional="true"/> -->
-		<provides specification="org.apache.felix.ipojo.test.composite.service.Tota">
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"
aggregate="true"/>
+		<!-- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"
aggregate ="true" optional="true"/> -->
+		<provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota">
 			<delegation method="tataInt" policy="One"/>
 			<delegation method="toto1" policy="All"/>
 		</provides>
 	</composite>	
 	
 	<composite name="comp-6" architecture="true">
-		<service specification="org.apache.felix.ipojo.test.composite.service.Tata" aggregate="true"/>
-		<requires specification="org.apache.felix.ipojo.test.composite.service.Toto" aggregate="true"
optional="true"/>
-		<provides specification="org.apache.felix.ipojo.test.composite.service.Toto">
+		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"
aggregate="true"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"
aggregate="true" optional="true"/>
+		<provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Toto">
 			<delegation method="toto1" policy="All"/>
 		</provides>
- 		<provides specification="org.apache.felix.ipojo.test.composite.service.Tata">
+ 		<provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tata">
 			<delegation method="tataInt" policy="One"/>
 		</provides>
 	</composite>
 	
 	<composite name="comp-7" architecture="true">
 		<instance component="tata"/>
-		<requires specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
-		<provides specification="org.apache.felix.ipojo.test.composite.service.Tota"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
+		<provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota"/>
 	</composite>
 	
 	<composite name="comp-8" architecture="true">
 		<instance component="tata"/>
 		<instance component="totoglue"/>
-		<requires specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
-		<provides specification="org.apache.felix.ipojo.test.composite.service.Tota"/>
+		<subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
+		<provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota"/>
 	</composite>
 	
 </ipojo>

Modified: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java?rev=631312&r1=631311&r2=631312&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
(original)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
Tue Feb 26 09:38:37 2008
@@ -98,5 +98,9 @@
  	public void setShort(short s) { this.s = s; }
 
 	public void setShorts(short[] ss) { this.ss = ss; }	
+	
+	public void setLong(long l, String s) {
+	    this.l = l;
+	}
 
 }

Modified: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java?rev=631312&r1=631311&r2=631312&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
(original)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
Tue Feb 26 09:38:37 2008
@@ -97,5 +97,10 @@
  	public void setShort(short s) { this.s = s; }
 
 	public void setShorts(short[] ss) { this.ss = ss; }	
+	
+	// This method has been added to test an issue when autoboxing.
+	public void setLong(long l, String s) {
+	    this.l = l;
+	}
 
 }

Modified: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java?rev=631312&r1=631311&r2=631312&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
(original)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
Tue Feb 26 09:38:37 2008
@@ -10,81 +10,95 @@
 
 public class PrimitiveTypeTest2 extends OSGiTestCase {
 
-	ComponentInstance instance; // Instance under test
-	PrimitiveManipulationTestService prim;
-	ServiceReference prim_ref;
-	
-	public void setUp() {
-		Properties p1 = new Properties();
-		p1.put("name", "primitives");
-		instance = Utils.getComponentInstance(context, "PrimitiveManipulationTesterA", p1);
-		assertTrue("check instance state", instance.getState() == ComponentInstance.VALID);
-		prim_ref = Utils.getServiceReferenceByName(context, PrimitiveManipulationTestService.class.getName(),
instance.getInstanceName());
-		assertNotNull("Check prim availability", prim_ref);
-		prim = (PrimitiveManipulationTestService) context.getService(prim_ref);
-	}
-	
-	public void tearDown() {
-		context.ungetService(prim_ref);
-		prim = null;
-		instance.dispose();
-		instance = null;
-	}
-	
-	public void testByte() {
-		assertEquals("Check - 1", prim.getByte(), 1);
-		prim.setByte((byte) 2);
-		assertEquals("Check - 2", prim.getByte(), 2);
-	}
-	
-	public void testShort() {
-		assertEquals("Check - 1", prim.getShort(), 1);
-		prim.setShort((short) 2);
-		assertEquals("Check - 2", prim.getShort(), 2);
-	}
-	
-	public void testInt() {
-		assertEquals("Check - 1", prim.getInt(), 1);
-		prim.setInt((int) 2);
-		assertEquals("Check - 2", prim.getInt(), 2);
-	}
-	
-	public void testLong() {
-		assertEquals("Check - 1", prim.getLong(), 1);
-		prim.setLong((long) 2);
-		assertEquals("Check - 2", prim.getLong(), 2);
-	}
-	
-	public void testLongFromObject() {
+    ComponentInstance instance; // Instance under test
+
+    PrimitiveManipulationTestService prim;
+
+    ServiceReference prim_ref;
+
+    public void setUp() {
+        Properties p1 = new Properties();
+        p1.put("name", "primitives");
+        instance = Utils.getComponentInstance(context, "PrimitiveManipulationTesterA", p1);
+        assertTrue("check instance state", instance.getState() == ComponentInstance.VALID);
+        prim_ref = Utils.getServiceReferenceByName(context, PrimitiveManipulationTestService.class.getName(),
instance.getInstanceName());
+        assertNotNull("Check prim availability", prim_ref);
+        prim = (PrimitiveManipulationTestService) context.getService(prim_ref);
+    }
+
+    public void tearDown() {
+        context.ungetService(prim_ref);
+        prim = null;
+        instance.dispose();
+        instance = null;
+    }
+
+    public void testByte() {
+        assertEquals("Check - 1", prim.getByte(), 1);
+        prim.setByte((byte) 2);
+        assertEquals("Check - 2", prim.getByte(), 2);
+    }
+
+    public void testShort() {
+        assertEquals("Check - 1", prim.getShort(), 1);
+        prim.setShort((short) 2);
+        assertEquals("Check - 2", prim.getShort(), 2);
+    }
+
+    public void testInt() {
+        assertEquals("Check - 1", prim.getInt(), 1);
+        prim.setInt((int) 2);
+        assertEquals("Check - 2", prim.getInt(), 2);
+    }
+
+    public void testLong() {
+        assertEquals("Check - 1", prim.getLong(), 1);
+        prim.setLong((long) 2);
+        assertEquals("Check - 2", prim.getLong(), 2);
+    }
+
+    public void testLong2() {
+        assertEquals("Check - 1", prim.getLong(), 1);
+        prim.setLong(2, "ss");
+        assertEquals("Check - 2", prim.getLong(), 2);
+    }
+
+    public void testLongFromObject() {
         assertEquals("Check - 1", prim.getLong(), 1);
         Long l = new Long(2);
         prim.setLong(l);
         assertEquals("Check - 2", prim.getLong(), 2);
     }
-	
-	public void testFloat() {
-		assertEquals("Check - 1", prim.getFloat(), 1.1f);
-		prim.setFloat(2.2f);
-		assertEquals("Check - 2", prim.getFloat(), 2.2f);
-	}
-	
-	public void testDouble() {
-		assertEquals("Check - 1", prim.getDouble(), 1.1);
-		prim.setDouble(2.2);
-		assertEquals("Check - 2", prim.getDouble(), 2.2);
-	}
-	
-	public void testBoolean() {
-		assertFalse("Check - 1", prim.getBoolean());
-		prim.setBoolean(true);
-		assertTrue("Check - 2", prim.getBoolean());
-	}
-	
-	public void testChar() {
-		assertEquals("Check - 1", prim.getChar(), 'a');
-		prim.setChar('b');
-		assertEquals("Check - 2", prim.getChar(), 'b');
-	}
-	
+
+    public void testLongFromObject2() {
+        assertEquals("Check - 1", prim.getLong(), 1);
+        Long l = new Long(2);
+        prim.setLong(l, "ss");
+        assertEquals("Check - 2", prim.getLong(), 2);
+    }
+
+    public void testFloat() {
+        assertEquals("Check - 1", prim.getFloat(), 1.1f);
+        prim.setFloat(2.2f);
+        assertEquals("Check - 2", prim.getFloat(), 2.2f);
+    }
+
+    public void testDouble() {
+        assertEquals("Check - 1", prim.getDouble(), 1.1);
+        prim.setDouble(2.2);
+        assertEquals("Check - 2", prim.getDouble(), 2.2);
+    }
+
+    public void testBoolean() {
+        assertFalse("Check - 1", prim.getBoolean());
+        prim.setBoolean(true);
+        assertTrue("Check - 2", prim.getBoolean());
+    }
+
+    public void testChar() {
+        assertEquals("Check - 1", prim.getChar(), 'a');
+        prim.setChar('b');
+        assertEquals("Check - 2", prim.getChar(), 'b');
+    }
 
 }

Modified: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/PrimitiveManipulationTestService.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/PrimitiveManipulationTestService.java?rev=631312&r1=631311&r2=631312&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/PrimitiveManipulationTestService.java
(original)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/PrimitiveManipulationTestService.java
Tue Feb 26 09:38:37 2008
@@ -50,5 +50,8 @@
 	
 	boolean[] getBooleans();
 	void setBooleans(boolean[] bs);	
+	
+	// This method has been added to test an issue when autoboxing.
+	void setLong(long l, String s);
 
 }



Mime
View raw message