Loading tools/XmlDiff/src/org/etsi/mts/ttcn/part9/xmldiff/LogUtil.java +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ public class LogUtil { record.setSourceMethodName(caller.getMethodName()); } logger.log(record); } public void severe(Object... args) { Loading tools/XmlDiff/src/org/etsi/mts/ttcn/part9/xmldiff/XmlDiff.java +47 −27 Original line number Diff line number Diff line Loading @@ -45,15 +45,18 @@ public class XmlDiff { public static LogUtil logger = null; static { logger = new LogUtil(Logger.getLogger("org.etsi.mts.ttcn.part9.xmldiff")); logger.logger.setLevel(Level.FINE); try { FileHandler fh = new FileHandler("XmlDiff.log", true); fh.setLevel(Level.INFO); fh.setLevel(Level.FINE); logger.logger.addHandler(fh); } catch (SecurityException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.err.println("XmlDiff class loaded"); } public static class IgnoreSchemePrefix implements DifferenceListener { Loading Loading @@ -113,6 +116,11 @@ public class XmlDiff { * */ public XmlDiff(File file, String[] xsdFileNames, String[] xsdSearchPath) { System.err.println("XmlDiff constructor called"); logger.debug("Reference file: ", file, ", xsd file names: ", (xsdFileNames == null)? "null" : Arrays.toString(xsdFileNames), ", xsd search path: ", (xsdSearchPath == null)? "null" : Arrays.toString(xsdSearchPath)); try { this.referenceXmlFile = file; if (!this.referenceXmlFile.exists()) { logger.severe("No such file: ", this.referenceXmlFile.getAbsolutePath()); Loading Loading @@ -140,6 +148,12 @@ public class XmlDiff { if (xsdFiles.size() > 0) { addXmlSchemas(); } } catch(Throwable err) { err.printStackTrace(); throw err; } finally { System.err.println("XmlDiff constructor finished"); } } /** Compare an XML document against the reference one. Loading Loading @@ -256,6 +270,12 @@ public class XmlDiff { List<String> missing = new ArrayList<String>(); if (xsdSearchPath == null || xsdSearchPath.length == 0) { for (String name : xsdFileNames) { if (name == null) { logger.severe("XSD file name is nul!!!"); continue; } else { logger.debug("Looking for XSD file ", name); } File guess = new File(name); if (guess.exists()) { xsdFiles.add(guess); Loading Loading
tools/XmlDiff/src/org/etsi/mts/ttcn/part9/xmldiff/LogUtil.java +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ public class LogUtil { record.setSourceMethodName(caller.getMethodName()); } logger.log(record); } public void severe(Object... args) { Loading
tools/XmlDiff/src/org/etsi/mts/ttcn/part9/xmldiff/XmlDiff.java +47 −27 Original line number Diff line number Diff line Loading @@ -45,15 +45,18 @@ public class XmlDiff { public static LogUtil logger = null; static { logger = new LogUtil(Logger.getLogger("org.etsi.mts.ttcn.part9.xmldiff")); logger.logger.setLevel(Level.FINE); try { FileHandler fh = new FileHandler("XmlDiff.log", true); fh.setLevel(Level.INFO); fh.setLevel(Level.FINE); logger.logger.addHandler(fh); } catch (SecurityException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.err.println("XmlDiff class loaded"); } public static class IgnoreSchemePrefix implements DifferenceListener { Loading Loading @@ -113,6 +116,11 @@ public class XmlDiff { * */ public XmlDiff(File file, String[] xsdFileNames, String[] xsdSearchPath) { System.err.println("XmlDiff constructor called"); logger.debug("Reference file: ", file, ", xsd file names: ", (xsdFileNames == null)? "null" : Arrays.toString(xsdFileNames), ", xsd search path: ", (xsdSearchPath == null)? "null" : Arrays.toString(xsdSearchPath)); try { this.referenceXmlFile = file; if (!this.referenceXmlFile.exists()) { logger.severe("No such file: ", this.referenceXmlFile.getAbsolutePath()); Loading Loading @@ -140,6 +148,12 @@ public class XmlDiff { if (xsdFiles.size() > 0) { addXmlSchemas(); } } catch(Throwable err) { err.printStackTrace(); throw err; } finally { System.err.println("XmlDiff constructor finished"); } } /** Compare an XML document against the reference one. Loading Loading @@ -256,6 +270,12 @@ public class XmlDiff { List<String> missing = new ArrayList<String>(); if (xsdSearchPath == null || xsdSearchPath.length == 0) { for (String name : xsdFileNames) { if (name == null) { logger.severe("XSD file name is nul!!!"); continue; } else { logger.debug("Looking for XSD file ", name); } File guess = new File(name); if (guess.exists()) { xsdFiles.add(guess); Loading