⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testtypedelementadapter.java

📁 开源框架
💻 JAVA
字号:
package org.infohazard.domify;

/**
 * Created by IntelliJ IDEA.
 * User: Geoffrey Mitchell
 * Date: Jan 29, 2006
 * Time: 1:06:40 PM
 * To change this template use File | Settings | File Templates.
 */

import static org.easymock.classextension.EasyMock.createNiceMock;
import static org.easymock.classextension.EasyMock.replay;
import junit.framework.*;
import org.infohazard.domify.TypedElementAdapter;
import org.w3c.dom.Node;
import org.w3c.dom.NamedNodeMap;

import java.util.Collection;
import java.util.Arrays;

public class TestTypedElementAdapter extends TestCase {
    TypedElementAdapter typedElementAdapter;
    Node parent;
    private DOMAdapter config;

    protected void setUp() throws Exception {
        parent = createNiceMock(Node.class);
        replay(parent);
        config = createNiceMock(DOMAdapter.class);
        replay(config);
    }

    public void testGetNamedNodeMapAdapter() throws Exception {
        typedElementAdapter=new TypedElementAdapter(new Object(),"test",parent,0,config);
        NamedNodeMap result = typedElementAdapter.getNamedNodeMapAdapter();
        assertEquals(1,result.getLength());
        assertEquals(TypedElementAdapter.ATTRNAME_TYPE,result.item(0).getNodeName());
    }
    public void testGetNamedNodeMapAdapterNullEntry() throws Exception {
        typedElementAdapter=new TypedElementAdapter(null,"test",parent,0,config);
        NamedNodeMap result = typedElementAdapter.getNamedNodeMapAdapter();
        assertEquals(1,result.getLength());
        assertEquals(TypedElementAdapter.ATTRNAME_TYPE,result.item(0).getNodeName());
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -