simplenumericitemtestcase.java

来自「xbrlapi的源码」· Java 代码 · 共 76 行

JAVA
76
字号
package org.xbrlapi.fragment.tests;import org.xbrlapi.DOMLoadingTestCase;import org.xbrlapi.FragmentList;import org.xbrlapi.SimpleNumericItem;/** * Tests the implementation of the org.xbrlapi.SimpleNumericItem interface. * Uses the DOM-based data store to ensure rapid testing. * @author Geoffrey Shuetrim (geoff@galexy.net) */public class SimpleNumericItemTestCase extends DOMLoadingTestCase {	private final String STARTING_POINT = "test.data.decimals";		protected void setUp() throws Exception {		super.setUp();		loader.discover(this.getURL(STARTING_POINT));			}	protected void tearDown() throws Exception {		super.tearDown();	}			public SimpleNumericItemTestCase(String arg0) {		super(arg0);	}	/**	 * Test getting value	 */	public void testGetValue() {        try {            FragmentList<SimpleNumericItem> items = store.<SimpleNumericItem>getFragments("SimpleNumericItem");            assertTrue(items.getLength() > 0);            for (SimpleNumericItem item: items) {                assertEquals("5.6", item.getValue());            }        } catch (Exception e) {            fail(e.getMessage());        }	}		/**	 * Test getting inferred precision.	 */	public void testGetInferredPrecision() {        try {            FragmentList<SimpleNumericItem> items = store.<SimpleNumericItem>getFragments("SimpleNumericItem");            assertTrue(items.getLength() > 0);            for (SimpleNumericItem item: items) {                assertEquals("5", item.getInferredPrecision());            }        } catch (Exception e) {            fail(e.getMessage());        }	}		/**	 * Test adjusting value for precision.	 */	public void testGetPrecisionAdjustedValue() {        try {            FragmentList<SimpleNumericItem> items = store.<SimpleNumericItem>getFragments("SimpleNumericItem");            assertTrue(items.getLength() > 0);            for (SimpleNumericItem item: items) {                assertEquals("5.6", item.getPrecisionAdjustedValue());            }        } catch (Exception e) {            fail(e.getMessage());        }	}	}

⌨️ 快捷键说明

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