Package net.sf.cb2java.data

Examples of net.sf.cb2java.data.GroupData


    public void testWeCanParseIntegers() throws FileNotFoundException, IOException {
        Copybook copybook = CopybookParser.parse("TYPES", new FileInputStream(new File("./src/test/resources/types.copybook")));
        List<Record> records = copybook.parseData(new FileInputStream(new File("./src/test/resources/types.txt")));
        Record record = records.get(0);
        GroupData integers = (GroupData) record.getChild("TYPES").getChildren().get(1);
        assertEquals(BigInteger.ZERO, integers.getChild("ZEROH").getValue());
        assertEquals(BigInteger.ONE,  integers.getChild("ONE").getValue());
        assertEquals(BigInteger.valueOf(9),   integers.getChild("NINE").getValue());
    }
View Full Code Here


    public void testWeCanParseNegativeIntegers() throws FileNotFoundException, IOException {
        Copybook copybook = CopybookParser.parse("TYPES", new FileInputStream(new File("./src/test/resources/types.copybook")));
        List<Record> records = copybook.parseData(new FileInputStream(new File("./src/test/resources/types.txt")));
        Record record = records.get(0);
        GroupData integers = (GroupData) record.getChild("TYPES").getChildren().get(1);
        // todo assertEquals(BigInteger.valueOf(-1),  integers.getChild("MINUSONE").getValue());
        // todo assertEquals(BigInteger.valueOf(-65), integers.getChild("MINUSSIXTYFIVE").getValue());
        // todo assertEquals(BigInteger.valueOf(-82), integers.getChild("EIGHTYTWO").getValue());
    }
View Full Code Here

            for (int j = 0; j < element.getOccurs(); j++) {
                dataChildren.add(element.create());
            }
        }
       
        return new GroupData(this, dataChildren);
    }
View Full Code Here

               
                pos = end;
            }
        }
       
        return new GroupData(this, dataChildren);
    }
View Full Code Here

TOP

Related Classes of net.sf.cb2java.data.GroupData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.