|
From: Loren C. <lor...@gm...> - 2018-06-28 15:04:25
|
I think I found what I am looking for. https://github.com/junit-team/junit4/wiki/Parameterized-tests <https://github.com/junit-team/junit4/wiki/Parameterized-tests> > On Jun 28, 2018, at 9:25 AM, Loren Cahlander <lor...@gm...> wrote: > > Folks, > > I have not done any JUnit development in a long time. Can any of you let me know what type of test to develop? > > Here is the test resource structure: > > <PastedGraphic-1.png> > > What I want to do is run the xqDoc generator against each file in the test/resources/XQuery and compare it against its corresponding file in test/resources/xqDoc. Each document in the XQuery folder is an individual test and should have its own test result. > > Thanks for any help, > Loren > >> On Jun 27, 2018, at 9:24 PM, Loren Cahlander <lor...@gm... <mailto:lor...@gm...>> wrote: >> >> The xqDoc core library project is available at: https://github.com/lcahlander/xqdoc-core <https://github.com/lcahlander/xqdoc-core> >> >> >> TBD: >> create the code to process and report the test cases >> Create test cases and test what the test should generate >> Move xqdoc-core to the EXQuery GitHub project >> Register the project with the maven project >> Develop an eXist EXPath function module that has a dependency on xqdoc-core >> Develop a WAR project that has a dependency on xqdoc-core >> >> Below is the README >> >> xqdoc-core >> >> Core module to process XQuery code source to an xqDoc XML file >> >> <https://github.com/lcahlander/xqdoc-core#building>Building >> >> Run the command: mvn clean install assembly:single >> >> Dependencies >> >> antlr >> commons-cli >> Results >> >> target/xqdoc-core-0.8-jar-with-dependencies.jar >> target/xqdoc-core-0.8.jar >> ##Command Line Call >> >> java -jar xqdoc-core-0.8-jar-with-dependencies.jar -Dprefix=uri -Dprefix=uri -f filepath >> >> The prefix/uri combination is for the prefixes that are not needed in an import module namespace for the implementation. >> >> e.g. -Dfn=http://www.w3.org/2003/05/xpath-functions <http://www.w3.org/2003/05/xpath-functions> is for the default XPath function library. This prefix/namespace is included by default. >> >> The filepath is the path name to the file with the XQuery source. >> >> <https://github.com/lcahlander/xqdoc-core#calling-from-java>Calling from java >> >> HashMap uriMap = new HashMap(); >> uriMap.put(XPathDriver.XPATH_PREFIX, XPathDriver.XPATH_URI); >> InputStream is = Files.newInputStream(Paths.get(cmd.getOptionValue("f"))); >> controller = new XQDocController(XQDocController.JUL2017); >> controller.setPredefinedFunctionNamespaces(uriMap); >> >> XQDocPayload payload = controller.process(is, ""); >> DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); >> DocumentBuilder db = dbf.newDocumentBuilder(); >> InputSource isOut = new InputSource(); >> isOut.setCharacterStream(new StringReader(payload.getXQDocXML())); >> >> Document doc = db.parse(isOut); >> >> >> >> > |