You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by fm...@apache.org on 2009/08/19 15:34:54 UTC

svn commit: r805797 - in /felix/trunk/scr/src/test: java/org/apache/felix/scr/impl/metadata/XmlHandlerTest.java resources/components_no_namespace.xml

Author: fmeschbe
Date: Wed Aug 19 13:34:53 2009
New Revision: 805797

URL: http://svn.apache.org/viewvc?rev=805797&view=rev
Log:
New test verifying that a single-component XML document without the
SCR name space is treated as if it would be declared with the SCR 1.0
namespace.

Added:
    felix/trunk/scr/src/test/resources/components_no_namespace.xml   (with props)
Modified:
    felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/XmlHandlerTest.java

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/XmlHandlerTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/XmlHandlerTest.java?rev=805797&r1=805796&r2=805797&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/XmlHandlerTest.java (original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/XmlHandlerTest.java Wed Aug 19 13:34:53 2009
@@ -52,6 +52,16 @@
     }
 
 
+    public void test_no_namespace() throws Exception
+    {
+        final List metadataList = readMetadata( "/components_no_namespace.xml" );
+        assertEquals( "1 Descriptor expected", 1, metadataList.size() );
+
+        final ComponentMetadata metadata = ( ComponentMetadata ) metadataList.get( 0 );
+        assertEquals( "Expect NS 1.0.0", XmlHandler.DS_VERSION_1_0, metadata.getNamespaceCode() );
+    }
+
+
     public void test_component_attributes_11() throws Exception
     {
         final List metadataList10 = readMetadata( "/components_activate_10.xml" );

Added: felix/trunk/scr/src/test/resources/components_no_namespace.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/resources/components_no_namespace.xml?rev=805797&view=auto
==============================================================================
--- felix/trunk/scr/src/test/resources/components_no_namespace.xml (added)
+++ felix/trunk/scr/src/test/resources/components_no_namespace.xml Wed Aug 19 13:34:53 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<component name="components.no.namespace" >
+    <implementation class="components.no.namespace" />
+</component>

Propchange: felix/trunk/scr/src/test/resources/components_no_namespace.xml
------------------------------------------------------------------------------
    svn:eol-style = native