felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1602631 [2/2] - in /felix/trunk/scr/src: main/java/org/apache/felix/scr/ main/java/org/apache/felix/scr/impl/ main/java/org/apache/felix/scr/impl/config/ main/java/org/apache/felix/scr/impl/manager/ main/java/org/apache/felix/scr/impl/meta...
Date Sun, 15 Jun 2014 01:09:19 GMT
Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetadataTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetadataTest.java?rev=1602631&r1=1602630&r2=1602631&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetadataTest.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetadataTest.java
Sun Jun 15 01:09:18 2014
@@ -20,6 +20,8 @@ package org.apache.felix.scr.impl.metada
 
 
 import java.lang.reflect.Array;
+import java.util.List;
+
 import junit.framework.TestCase;
 
 import org.apache.felix.scr.impl.MockLogger;
@@ -715,7 +717,7 @@ public class ComponentMetadataTest exten
       ComponentMetadata cm = createComponentMetadata11( null, null );
         try
         {
-          cm.setConfigurationPid( "configurationPid" );
+          cm.setConfigurationPid( new String[] {"configurationPid"} );
           cm.validate( logger );
           fail( "Expect validation failure for illegal configuration-pid usage in ds 1.1
namespace" );
         }
@@ -727,7 +729,7 @@ public class ComponentMetadataTest exten
         cm = createComponentMetadata12( null, null );
         try
         {
-          cm.setConfigurationPid( "configurationPid" );
+          cm.setConfigurationPid( new String[] {"configurationPid"} );
           cm.validate( logger );
         }
         catch ( ComponentException ce )
@@ -761,10 +763,10 @@ public class ComponentMetadataTest exten
             {
                 fail( "Expect correct validation for unnamed component" );
             }
-            String pid = cm.getConfigurationPid();
-            assertNotNull( "Expect non-null configuration pid when component name is not
specified", pid );
+            List<String> pid = cm.getConfigurationPid();
+            assertFalse( "Expect non-null configuration pid when component name is not specified",
pid.isEmpty() );
             assertEquals( "Expect configuration-pid to be equals to component implementation",
-                          "implementation.class", cm.getConfigurationPid() );
+                          "implementation.class", pid.get( 0 ) );
         }
 
         // Make sure that getConfigurationPid returns the name of the component, if specified
@@ -779,10 +781,10 @@ public class ComponentMetadataTest exten
         {
             fail( "Expect correct validation for named component" );
         }
-        String pid = cm.getConfigurationPid();
-        assertNotNull( "Expect non-null configuration pid when component name is specified",
pid );
+        List<String> pid = cm.getConfigurationPid();
+        assertFalse( "Expect non-null configuration pid when component name is not specified",
pid.isEmpty() );
         assertEquals( "Expect configuration-pid to be equals to component name",
-                      "my.component.name", cm.getConfigurationPid() );
+                      "my.component.name", pid.get( 0 ) );
     }
 
     public void test_property_character_ds11() throws ComponentException



Mime
View raw message