incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mschma...@apache.org
Subject svn commit: r1409222 - /incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java
Date Wed, 14 Nov 2012 15:16:22 GMT
Author: mschmalle
Date: Wed Nov 14 15:16:22 2012
New Revision: 1409222

URL: http://svn.apache.org/viewvc?rev=1409222&view=rev
Log:
FLEX-33241 Added test for duplicate css namespace exception that Tests commit 1407665

Modified:
    incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java

Modified: incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java?rev=1409222&r1=1409221&r2=1409222&view=diff
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java
(original)
+++ incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java
Wed Nov 14 15:16:22 2012
@@ -23,6 +23,7 @@ import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertThat;
 
 import org.apache.flex.compiler.css.ICSSDocument;
+import org.apache.flex.compiler.css.ICSSNamespaceDefinition;
 import org.apache.flex.compiler.css.ICSSRule;
 import org.apache.flex.compiler.internal.caches.CSSDocumentCache;
 import org.apache.flex.compiler.tree.ASTNodeID;
@@ -111,4 +112,23 @@ public class MXMLStyleNodeTests extends 
 		assertThat("rule 0 name", rules.get(0).getSelectorGroup().get(0).getElementName(), is("Button"));
 		assertThat("rule 1 name", rules.get(1).getSelectorGroup().get(0).getElementName(), is("CheckBox"));
 	}
+	
+	@Test
+	public void MXMLStyleNode_two_same_namespaces()
+	{
+		String code =
+			"<fx:Style>" + EOL +
+			"    @namespace \"library://ns.adobe.com/flex/mx\";" + EOL +
+			"    @namespace \"library://ns.adobe.com/flex/mx\";" + EOL +
+			"</fx:Style>";
+		IMXMLStyleNode node = getMXMLStyleNode(code);
+		assertThat("getChildCount", node.getChildCount(), is(0));
+		ICSSDocument css = node.getCSSDocument(null);
+		ImmutableList<ICSSNamespaceDefinition> namespaces = css.getAtNamespaces();
+		assertThat("namespaces", namespaces.size(), is(2));
+		assertThat("namespace 0 prefix ", namespaces.get(0).getPrefix(), is((String)null));
+		assertThat("namespace 0 uri", namespaces.get(0).getURI(), is("library://ns.adobe.com/flex/mx"));
+		assertThat("namespace 1 prefix", namespaces.get(1).getPrefix(), is((String)null));
+		assertThat("namespace 1 uri", namespaces.get(1).getURI(), is("library://ns.adobe.com/flex/mx"));
+	}
 }



Mime
View raw message