@Test public void testInputFileValidation() { try { Cob2XsdIO cob2xsd = new Cob2XsdIO(defaultConfig); cob2xsd.checkCobolSourceFile(null); fail(); } catch (Exception e) { assertEquals( "java.io.IOException: You must provide a COBOL source file", e.toString()); } try { Cob2XsdIO cob2xsd = new Cob2XsdIO(defaultConfig); cob2xsd.checkCobolSourceFile(new File("toto")); fail(); } catch (Exception e) { assertEquals( "java.io.IOException: COBOL source file toto not found", e.toString()); } }
protected void checkCobolSourceFile(final File cobolSourceFile) throws IOException { if (cobolSourceFile == null) { throw new IOException("You must provide a COBOL source file"); } if (!cobolSourceFile.exists()) { throw new IOException("COBOL source file " + cobolSourceFile + " not found"); } }
Cob2XsdIO extends Cob2Xsd { protected void checkCobolSourceFile(final File cobolSourceFile) throws IOException { if (cobolSourceFile == null) { throw new IOException("You must provide a COBOL source file"); } if (!cobolSourceFile.exists()) { throw new IOException("COBOL source file " + cobolSourceFile + " not found"); } } }
Cob2XsdIO extends Cob2Xsd { protected void checkCobolSourceFile(final File cobolSourceFile) throws IOException { if (cobolSourceFile == null) { throw new IOException("You must provide a COBOL source file"); } if (!cobolSourceFile.exists()) { throw new IOException("COBOL source file " + cobolSourceFile + " not found"); } } Cob2XsdIO(final Cob2XsdConfig config); }
Cob2XsdIO extends Cob2Xsd { protected void checkCobolSourceFile(final File cobolSourceFile) throws IOException { if (cobolSourceFile == null) { throw new IOException("You must provide a COBOL source file"); } if (!cobolSourceFile.exists()) { throw new IOException("COBOL source file " + cobolSourceFile + " not found"); } } Cob2XsdIO(final Cob2XsdConfig config); File translate(final File cobolFile, final String cobolFileEncoding,
            final File target, final String targetNamespacePrefix,
            final String xsltFileName); }
Cob2XsdIO extends Cob2Xsd { protected void checkCobolSourceFile(final File cobolSourceFile) throws IOException { if (cobolSourceFile == null) { throw new IOException("You must provide a COBOL source file"); } if (!cobolSourceFile.exists()) { throw new IOException("COBOL source file " + cobolSourceFile + " not found"); } } Cob2XsdIO(final Cob2XsdConfig config); File translate(final File cobolFile, final String cobolFileEncoding,
            final File target, final String targetNamespacePrefix,
            final String xsltFileName);  }