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

📄 concepttestcase.java

📁 xbrlapi的源码
💻 JAVA
字号:
package org.xbrlapi.fragment.tests;import org.xbrlapi.Concept;import org.xbrlapi.DOMLoadingTestCase;import org.xbrlapi.Fact;import org.xbrlapi.FragmentList;import org.xbrlapi.utilities.XBRLException;/** * Tests the implementation of the org.xbrlapi.Concept interface. * Uses the DOM-based data store to ensure rapid testing. * @author Geoffrey Shuetrim (geoff@galexy.net) */public class ConceptTestCase extends DOMLoadingTestCase {	private final String STARTING_POINT = "test.data.footnote.links";	private final String STARTING_POINT_2 = "test.data.label.links";		protected void setUp() throws Exception {		super.setUp();		loader.discover(this.getURL(STARTING_POINT));			}	protected void tearDown() throws Exception {		super.tearDown();	}			public ConceptTestCase(String arg0) {		super(arg0);	}	public void testGetPeriodType() {	        try {            FragmentList<Concept> concepts = store.<Concept>getFragments("Concept");            assertTrue(concepts.getLength() > 0);            for (Concept concept: concepts) {                if (concept.getName().equals("CurrentAsset"))                    assertEquals("duration", concept.getPeriodType());            }        } catch (Exception e) {            fail(e.getMessage());        }	}	    public void testGetFacts() {           boolean testDone = false;        try {            FragmentList<Concept> concepts = store.<Concept>getFragments("Concept");            assertTrue(concepts.getLength() > 0);            for (Concept concept: concepts) {                FragmentList<Fact> facts = concept.getFacts();                for (Fact fact: facts) {                    assertEquals(fact.getLocalname(), fact.getConcept().getName());                    testDone = true;                }            }            assertTrue(testDone);        } catch (Exception e) {            fail(e.getMessage());        }    }			public void testGetBalance() {			try {            FragmentList<Concept> concepts = store.<Concept>getFragments("Concept");            assertTrue(concepts.getLength() > 0);            for (Concept concept: concepts) {                if (concept.getName().equals("CurrentAsset"))                    assertNull(concept.getBalance());            }		} catch (Exception e) {			fail(e.getMessage());		}	}	public void testGetLocators() {	        try {            FragmentList<Concept> concepts = store.<Concept>getFragments("Concept");            assertTrue(concepts.getLength() > 0);            for (Concept concept: concepts) {                if (concept.getName().equals("CurrentAsset"))                    assertEquals(0,concept.getReferencingLocators().getLength());            }        } catch (Exception e) {            fail(e.getMessage());        }	}			public void testGetLabels() {		try {			loader.discover(this.getURL(STARTING_POINT_2));					FragmentList<Concept> concepts = store.getFragments("Concept");			for (Concept concept: concepts) {				if (concept.getName().equals("CurrentAsset"))					assertEquals(3,concept.getLabels().getLength());			}		} catch (XBRLException e) {			fail(e.getMessage());		}	}}

⌨️ 快捷键说明

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