felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1345698 - /felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetadataTest.java
Date Sun, 03 Jun 2012 16:26:06 GMT
Author: pderop
Date: Sun Jun  3 16:26:06 2012
New Revision: 1345698

URL: http://svn.apache.org/viewvc?rev=1345698&view=rev
Log:
FELIX-3524: Added test_configuration_pid_use_ds12 for validation of configuration-pid usage
in the proper ds12 namespace.

Modified:
    felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetadataTest.java

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=1345698&r1=1345697&r2=1345698&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  3 16:26:06 2012
@@ -697,6 +697,33 @@ public class ComponentMetadataTest exten
         }
     }
 
+    public void test_configuration_pid_use_ds12()
+    {
+      ComponentMetadata cm = createComponentMetadata11( null, null );
+        try
+        {
+          cm.setConfigirationPid( "configurationPid" );
+          cm.validate( logger );
+          fail( "Expect validation failure for illegal configuration-pid usage in ds 1.1
namespace" );
+        }
+        catch ( ComponentException ce )
+        {
+            // expected
+        }
+        
+        cm = createComponentMetadata12( null, null );
+        try
+        {
+          cm.setConfigirationPid( "configurationPid" );
+          cm.validate( logger );
+        }
+        catch ( ComponentException ce )
+        {
+          ce.printStackTrace();
+          fail( "Expect correct validation for legal configuration-pid usage in ds 1.2 or
later namespace" );
+        }
+    }
+
 
     public void test_property_character_ds11() throws ComponentException
     {
@@ -761,6 +788,11 @@ public class ComponentMetadataTest exten
         return createComponentMetadata( XmlHandler.DS_VERSION_1_1, immediate, factory );
     }
 
+    // Creates DS 1.2 Component Metadata
+    private ComponentMetadata createComponentMetadata12( Boolean immediate, String factory
)
+    {
+        return createComponentMetadata( XmlHandler.DS_VERSION_1_2, immediate, factory );
+    }
 
     private ServiceMetadata createServiceMetadata( Boolean serviceFactory )
     {



Mime
View raw message