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

📄 unittestcase.java

📁 xbrlapi的源码
💻 JAVA
字号:
package org.xbrlapi.fragment.tests;import org.xbrlapi.DOMLoadingTestCase;import org.xbrlapi.FragmentList;import org.xbrlapi.Unit;/** * Tests the implementation of the org.xbrlapi.Unit interface. * Uses the DOM-based data store to ensure rapid testing. * @author Geoffrey Shuetrim (geoff@galexy.net) */public class UnitTestCase extends DOMLoadingTestCase {	private final String STARTING_POINT = "test.data.units.simple";		protected void setUp() throws Exception {		super.setUp();		loader.discover(this.getURL(STARTING_POINT));			}	protected void tearDown() throws Exception {		super.tearDown();	}			public UnitTestCase(String arg0) {		super(arg0);	}	/**	 * Test checking for denopminator.	 */	public void testHasDenominator() {		try {		    FragmentList<Unit> units = store.<Unit>getFragments("Unit");		    assertTrue(units.getLength() > 0);		    for (Unit unit: units) {	            assertFalse(unit.hasDenominator());		    }		} catch (Exception e) {			fail(e.getMessage());		}	}		/**	 * Test getting numerator measures.	 */	public void testGetNumeratorMeasures() {		try {            FragmentList<Unit> units = store.<Unit>getFragments("Unit");            assertTrue(units.getLength() > 0);            for (Unit unit: units) {                assertFalse(unit.hasDenominator());                assertEquals(2,unit.getNumeratorMeasures().getLength());            }		} catch (Exception e) {			fail(e.getMessage());		}	}		/**	 * Test getting denominator measures.	 */	public void testGetDenominatorMeasures() {        try {            FragmentList<Unit> units = store.<Unit>getFragments("Unit");            assertTrue(units.getLength() > 0);            for (Unit unit: units) {                assertNull(unit.getDenominatorMeasures());            }        } catch (Exception e) {            fail(e.getMessage());        }	}		/**	 * Test checking equality.	 */	public void testCheckEquality() {        try {            FragmentList<Unit> units = store.<Unit>getFragments("Unit");            assertTrue(units.getLength() > 0);            for (Unit unit: units) {                assertTrue(unit.equals(unit));            }        } catch (Exception e) {            fail(e.getMessage());        }	}	}

⌨️ 快捷键说明

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