/*
 *
 *  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.
 *
 */
package org.apache.flex.compiler.internal.codegen.mxml.vf2js;

import org.apache.flex.compiler.internal.test.MXMLTestBase;
import org.apache.flex.compiler.internal.test.VF2JSTestBase;
import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
import org.junit.Test;

public class TestVF2JSMXMLNodes extends VF2JSTestBase
{

    @Test
    public void testSimpleNode()
    {
        String code = "<s:Button />";

        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
                code, IMXMLPropertySpecifierNode.class,
                MXMLTestBase.WRAP_LEVEL_DOCUMENT);

        mxmlBlockWalker.visitPropertySpecifier(node);

        assertOut("<Button></Button>");
    }

}

@@ -1184,16 +1184,22 @@
 stSimple
+Button
 Node()%0A 
@@ -1532,10 +1532,1505 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testButtonNodeWithVF2JSAttribute()%0A    %7B%0A        String code = %22%3Cs:Button label=%5C%22hello%5C%22 /%3E%22;%0A%0A        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(%0A                code, IMXMLPropertySpecifierNode.class,%0A                MXMLTestBase.WRAP_LEVEL_DOCUMENT);%0A%0A        mxmlBlockWalker.visitPropertySpecifier(node);%0A%0A        assertOut(%22%3CButton label=%5C%22hello%5C%22%3E%3C/Button%3E%22);%0A    %7D%0A%0A    @Test%0A    public void testButtonNodeWithNonVF2JSAttribute()%0A    %7B%0A        String code = %22%3Cs:Button string=%5C%22bye%5C%22 /%3E%22;%0A%0A        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(%0A                code, IMXMLPropertySpecifierNode.class,%0A                MXMLTestBase.WRAP_LEVEL_DOCUMENT);%0A%0A        mxmlBlockWalker.visitPropertySpecifier(node);%0A%0A        // (erikdebruin) The attribute doesn't exist in VF2JS, so it's ignored%0A        assertOut(%22%3CButton%3E%3C/Button%3E%22);%0A    %7D%0A    %0A    @Test%0A    public void testButtonNodeWithBothVF2JSAndNonVF2JSAttribute()%0A    %7B%0A        String code = %22%3Cs:Button label=%5C%22hello%5C%22 string=%5C%22bye%5C%22 /%3E%22;%0A        %0A        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(%0A                code, IMXMLPropertySpecifierNode.class,%0A                MXMLTestBase.WRAP_LEVEL_DOCUMENT);%0A        %0A        mxmlBlockWalker.visitPropertySpecifier(node);%0A        %0A        // (erikdebruin) The attribute 'string' doesn't exist in VF2JS, so it's ignored%0A        assertOut(%22%3CButton label=%5C%22hello%5C%22%3E%3C/Button%3E%22);%0A    %7D%0A%0A
 %7D%0A

Update VF2JS MXML node tests with tests for attributes.