Menu

Occurs depending on in newCobol2Xml

2015-10-21
2016-11-18
<< < 1 2 (Page 2 of 2)
  • Bruce Martin

    Bruce Martin - 2016-10-20

    I have uploaded a new JRecord (with updated pom files):

    https://sourceforge.net/projects/jrecord/files/jrecord/Version_0.81.3/

    in the source/OtherSource/JRecord_Cobol2Xml_package there is the CobolToXml source with pom files.

    I will update the CobolToXml project tommorow

     

    Last edit: Bruce Martin 2016-10-20
  • John Power

    John Power - 2016-10-20

    Many thanks. I successfully build the source/OtherSource/JRecord_Cobol2Xml_package project but only after modifying the source/OtherSource/JRecord_Cobol2Xml_package/pom.xml to have the following version:
    <version>0.81.3</version>
    In the download it had 0.80.3.

    When I build jrecord, I get errors during testing like the following which I'm assuming means I'm missing something so I have built with -DskipTests=true for now and will test out the DEPENDS ON changes:

    *** using start column = 6, end column = 72
    java.io.FileNotFoundException: cb2xml.properties (The system cannot find the file specified)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at net.sf.cb2xml.CobolPreprocessor.preProcess(CobolPreprocessor.java:58)
    at net.sf.cb2xml.Cb2Xml2.convert(Cb2Xml2.java:236)
    at net.sf.cb2xml.Cb2Xml2.convert(Cb2Xml2.java:171)
    at net.sf.cb2xml.Cb2Xml2.convertToXMLDOM(Cb2Xml2.java:86)
    at net.sf.JRecord.External.Def.Cb2Xml.convertToXMLDOM(Cb2Xml.java:144)
    at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:207)
    at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:185)
    at net.sf.JRecord.zTest.Common.TestCommonCode.getExternalRecordFromCobolStr(TestCommonCode.java:155)
    at net.sf.JRecord.zTest.Common.TestCommonCode.getLayoutFromCobolStr(TestCommonCode.java:142)
    at net.sf.JRecord.zTest.Details.TstGroupFieldAccess1.<init>(TstGroupFieldAccess1.java:75)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at junit.framework.TestSuite.createTest(TestSuite.java:61)
    at junit.framework.TestSuite.addTestMethod(TestSuite.java:283)
    at junit.framework.TestSuite.<init>(TestSuite.java:146)
    at org.junit.internal.runners.JUnit38ClassRunner.<init>(JUnit38ClassRunner.java:69)
    at sun.reflect.GeneratedConstructorAccessor1.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.junit.internal.requests.ClassRequest.buildRunner(ClassRequest.java:33)
    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
    at org.junit.internal.requests.ClassesRequest.getRunner(ClassesRequest.java:21)
    at org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.createSuiteDescription(JUnit4ProviderUtil.java:113)
    at org.apache.maven.surefire.junit4.JUnit4Provider.createTestsDescription(JUnit4Provider.java:257)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

     
  • John Power

    John Power - 2016-10-20

    Looking a lot better but one minor issue that I can see. Using the following COBOL structure:

       01 CUSTOMER-DATA.
          05 CUSTOMER-NUMBER                 PIC 9(9).
          05 LAST-NAME                       PIC X(20).
          05 FIRST-NAME                      PIC X(20).
          05 INVOICE-COUNT                   PIC 9(7) .
          05 INVOICES OCCURS 0 to 50 TIMES DEPENDING ON INVOICE-COUNT.
             10 INVOICE-NUMBER               PIC X(10).
             10 INVOICE-DATE                 PIC X(10) .
             10 INVOICE-AMOUNT               PIC 9 (4).
             10 INVOICE-DESCRIPTION          PIC X(20).
             10 INV-SUB-CT    PIC 9(4) .
             10 SUB-INVS OCCURS 0 to 10 TIMES DEPENDING ON INV-SUB-CT.
                15 SUB-INVOICES-DATA PIC X(6).
    

    I used created a file with INVOICE-COUNT=2 and in each INVOICES entry I set INV-SUB-CT=2. This resulted in the following XML output. So it correctly only prints 2 INVOICES but seems to always print 10 SUB-INVS even though the data is empty picking up subsequent invoice data in the first INVOICE ? Interestly, it doesn't loose it's place and still processes the second customer record correctly. Is there something further you'd like me to try here ?

    <CobolData> <CUSTOMER-DATA> <CUSTOMER-NUMBER>1</CUSTOMER-NUMBER> <LAST-NAME>test-lastname</LAST-NAME> <FIRST-NAME>test-firstname</FIRST-NAME> <INVOICE-COUNT>2</INVOICE-COUNT> <INVOICES> <INVOICE-NUMBER>INV0000001</INVOICE-NUMBER> <INVOICE-DATE>2016-12-01</INVOICE-DATE> <INVOICE-AMOUNT>1000</INVOICE-AMOUNT> <INVOICE-DESCRIPTION>Invoice for cable1</INVOICE-DESCRIPTION> <INV-SUB-CT>2</INV-SUB-CT> <SUB-INVS> <SUB-INVOICES-DATA>INVS11</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA>INVS12</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA>INV000</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA>000220</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA>16-12-</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA>022000</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA>Invoic</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA>e for</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA>cable2</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA> 0002</SUB-INVOICES-DATA> </SUB-INVS> </INVOICES> <INVOICES> <INVOICE-NUMBER>INV0000002</INVOICE-NUMBER> <INVOICE-DATE>2016-12-02</INVOICE-DATE> <INVOICE-AMOUNT>2000</INVOICE-AMOUNT> <INVOICE-DESCRIPTION>Invoice for cable2</INVOICE-DESCRIPTION> <INV-SUB-CT>2</INV-SUB-CT> <SUB-INVS> <SUB-INVOICES-DATA>INVS21</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA>INVS22</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> </INVOICES> </CUSTOMER-DATA> <CUSTOMER-DATA> <CUSTOMER-NUMBER>2</CUSTOMER-NUMBER> <LAST-NAME>test-lastname2</LAST-NAME> <FIRST-NAME>test-firstname2</FIRST-NAME> <INVOICE-COUNT>1</INVOICE-COUNT> <INVOICES> <INVOICE-NUMBER>INV0000001</INVOICE-NUMBER> <INVOICE-DATE>2015-12-01</INVOICE-DATE> <INVOICE-AMOUNT>1000</INVOICE-AMOUNT> <INVOICE-DESCRIPTION>Invoice for cable6</INVOICE-DESCRIPTION> <INV-SUB-CT>1</INV-SUB-CT> <SUB-INVS> <SUB-INVOICES-DATA>INVS1</SUB-INVOICES-DATA> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> <SUB-INVS> <SUB-INVOICES-DATA/> </SUB-INVS> </INVOICES> </CUSTOMER-DATA> </CobolData>
     
  • Bruce Martin

    Bruce Martin - 2016-10-20

    I will fix that up.

     
  • John Power

    John Power - 2016-10-21

    Thanks. Let me know if I can help with anything.

     
  • Bruce Martin

    Bruce Martin - 2016-10-21

    not at this stage, I should have something to test on Monday / Tuesday.

    Will write tests next week.

     
  • John Power

    John Power - 2016-10-21

    OK. Sounds good. Happy to pick this up when you have the time...

     
  • Bruce Martin

    Bruce Martin - 2016-10-24

    I have created an update version:

    JRecord_Version_0.81.3_Update.7z

    It contains:

    • updated JRecord and Cobol2Xml jars
    • Updated source code etc
     
  • John Power

    John Power - 2016-10-24

    JRecord build still seems to have issue with test cases failing. Compiled and skipped tests for now.

    JRecord_Version_0.81.3_Update\Source\OtherSource\JRecord_Cobol2Xml_package/pom.xml still has <version>0.80.3</version>. When I change to <version>0.81.3</version> it compiles cleanly.

    I'm afraid I'm still seeing exactly the same behaviour as described above. Perhaps I have missed a step ?

     
  • Bruce Martin

    Bruce Martin - 2016-10-25

    I will check what I missed. I have more testing to do anyway

     
  • Bruce Martin

    Bruce Martin - 2016-10-25

    I have just tried running the invoice example with my jars, it seems to be working OK.

    See

    example/data2xml_ODarrays.bat in the following

     
  • John Power

    John Power - 2016-10-25

    Sorry, it appears I had an older dependency. Once I pick up the CobolToXml dependency, it all looks good.

    Are you expecting the test failures in the jrecord build ?

    What about the Cobol2Xml pom version issue ?

    Just want to make sure I'm not missing something else :-)

     
  • Bruce Martin

    Bruce Martin - 2016-10-25

    Basically I plan to do more testing & test Cobol2Json as well. I will probably do a release next week. I will try building in a Linux VM.

    Are you expecting the test failures in the jrecord build ? No; let me know which tests failed

    What about the Cobol2Xml pom version issue ? Will be fixed in the next version.

     
  • John Power

    John Power - 2016-10-26

    OK. Thanks for the feedback. I suspect the test failures in the jrecord build are a build issue on my side but I just wanted to be sure before digging further. I'll dig further and if I cannot work it out, I'll let you know what I'm seeing.

     
  • John Power

    John Power - 2016-11-04

    Sorry, got distracted. Actually none of the tests are failing. What caused me confusion was that I got a lot of the following errors on the console which gave me the impression it was failing. The report at the end is all successful so....user error.

    using start column = 6, end column = 72
    java.io.FileNotFoundException: cb2xml.properties (The system cannot find the file specified)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at net.sf.cb2xml.CobolPreprocessor.preProcess(CobolPreprocessor.java:58)
    at net.sf.cb2xml.Cb2Xml2.convert(Cb2Xml2.java:236)
    at net.sf.cb2xml.Cb2Xml2.convert(Cb2Xml2.java:171)
    at net.sf.cb2xml.Cb2Xml2.convertToXMLDOM(Cb2Xml2.java:86)
    at net.sf.JRecord.External.Def.Cb2Xml.convertToXMLDOM(Cb2Xml.java:144)
    at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:207)
    at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:185)
    at net.sf.JRecord.zTest.Common.TestCommonCode.getExternalRecordFromCobolStr(TestCommonCode.java:155)
    at net.sf.JRecord.zTest.Common.TestCommonCode.getLayoutFromCobolStr(TestCommonCode.java:142)
    at net.sf.JRecord.zTest.Types.TstTypesGeneral.testAssignment(TstTypesGeneral.java:265)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
    using start column = 6, end column = 72
    java.io.FileNotFoundException: cb2xml.properties (The system cannot find the file specified)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at net.sf.cb2xml.CobolPreprocessor.preProcess(CobolPreprocessor.java:58)
    at net.sf.cb2xml.Cb2Xml2.convert(Cb2Xml2.java:236)
    at net.sf.cb2xml.Cb2Xml2.convert(Cb2Xml2.java:171)
    at net.sf.cb2xml.Cb2Xml2.convertToXMLDOM(Cb2Xml2.java:86)
    at net.sf.JRecord.External.Def.Cb2Xml.convertToXMLDOM(Cb2Xml.java:144)
    at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:207)
    at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:185)
    at net.sf.JRecord.zTest.Common.TestCommonCode.getExternalRecordFromCobolStr(TestCommonCode.java:155)
    at net.sf.JRecord.zTest.Common.TestCommonCode.getLayoutFromCobolStr(TestCommonCode.java:142)
    at net.sf.JRecord.zTest.Types.TstTypesGeneral.testAssignment(TstTypesGeneral.java:265)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
    *** using start column = 6, end column = 72

     
  • John Power

    John Power - 2016-11-18

    Thanks. Will pick this up and bring it for a run next week.

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.