| | |
| | | * Dgn7OracleReaderTest |
| | | * User: Ulysses |
| | | * Date: 2007/10/24 |
| | | * Time: ¤W¤È 10:49:54 |
| | | */ |
| | | public class Dgn7OracleReaderTest |
| | | { |
| | | public class Dgn7OracleReaderTest { |
| | | @BeforeTest |
| | | public void setUp() |
| | | { |
| | | public void setUp() { |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void testOracleReader() throws SQLException, IOException |
| | | { |
| | | // @Test |
| | | public void testOracleReader() throws SQLException, IOException { |
| | | OracleConnection connection = OracleTarget.getInstance().getOracleConnection(); |
| | | // String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" ORDER BY ROWID"; |
| | | String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" WHERE TAG_SFSC=106 ORDER BY ROWID"; |
| | |
| | | |
| | | Dgn7OracleReader reader = new Dgn7OracleReader(fetchSrcStmt, "IGDSELM", connection); |
| | | int count = 0; |
| | | while (reader.hasNext()) |
| | | { |
| | | while (reader.hasNext()) { |
| | | Element element = reader.next(); |
| | | |
| | | if (element instanceof ComplexChainElement) |
| | | { |
| | | if (element instanceof ComplexChainElement) { |
| | | ComplexChainElement complexChain = (ComplexChainElement) element; |
| | | FrammeAttributeData frammeLinkage = null; |
| | | |
| | | List<UserAttributeData> attrs = complexChain.getUserAttributeData(); |
| | | for (int k = 0; k < attrs.size(); k++) |
| | | { |
| | | for (int k = 0; k < attrs.size(); k++) { |
| | | UserAttributeData userAttr = attrs.get(k); |
| | | if (userAttr instanceof FrammeAttributeData) |
| | | { |
| | | if (userAttr instanceof FrammeAttributeData) { |
| | | frammeLinkage = (FrammeAttributeData) userAttr; |
| | | break; |
| | | } |
| | |
| | | System.out.print("complexChain:"); |
| | | if (frammeLinkage != null) |
| | | System.out.print(":FSC-" + frammeLinkage.getFsc() + |
| | | ":UFID-" + frammeLinkage.getUfid() + |
| | | ":COMP-" + frammeLinkage.getComponentID()); |
| | | ":UFID-" + frammeLinkage.getUfid() + |
| | | ":COMP-" + frammeLinkage.getComponentID()); |
| | | else |
| | | System.out.print("Linkage is null"); |
| | | |
| | | for (int i = 0; i < complexChain.size(); i++) |
| | | { |
| | | for (int i = 0; i < complexChain.size(); i++) { |
| | | Element elm = (Element) complexChain.get(i); |
| | | if (elm instanceof LineStringElement) |
| | | { |
| | | if (elm instanceof LineStringElement) { |
| | | LineStringElement lineStringElement = (LineStringElement) elm; |
| | | int size = lineStringElement.getVerticeSize(); |
| | | System.out.print("size=" + size + ":"); |
| | |
| | | } |
| | | |
| | | System.out.println(); |
| | | } else if (element instanceof TextNodeElement) |
| | | { |
| | | } else if (element instanceof TextNodeElement) { |
| | | TextNodeElement textNode = (TextNodeElement) element; |
| | | |
| | | FrammeAttributeData frammeLinkage = null; |
| | | |
| | | List<UserAttributeData> attrs = textNode.getUserAttributeData(); |
| | | for (int k = 0; k < attrs.size(); k++) |
| | | { |
| | | for (int k = 0; k < attrs.size(); k++) { |
| | | UserAttributeData userAttr = attrs.get(k); |
| | | if (userAttr instanceof FrammeAttributeData) |
| | | { |
| | | if (userAttr instanceof FrammeAttributeData) { |
| | | frammeLinkage = (FrammeAttributeData) userAttr; |
| | | break; |
| | | } |
| | |
| | | System.out.print("TextNode:origin=" + coord.toString()); |
| | | if (frammeLinkage != null) |
| | | System.out.print(":FSC-" + frammeLinkage.getFsc() + |
| | | ":UFID-" + frammeLinkage.getUfid() + |
| | | ":COMP-" + frammeLinkage.getComponentID()); |
| | | ":UFID-" + frammeLinkage.getUfid() + |
| | | ":COMP-" + frammeLinkage.getComponentID()); |
| | | else |
| | | System.out.print("Linkage is null"); |
| | | for (int i = 0; i < textNode.size(); i++) |
| | | { |
| | | for (int i = 0; i < textNode.size(); i++) { |
| | | Element elm = (Element) textNode.get(i); |
| | | if (elm instanceof TextElement) |
| | | { |
| | | if (elm instanceof TextElement) { |
| | | TextElement textElm = (TextElement) elm; |
| | | System.out.print("---"); |
| | | String text = textElm.getText(); |