From 290b08439894c777ac6f13ac65c7ecb59af4fb7b Mon Sep 17 00:00:00 2001 From: Mads Hansen Date: Tue, 11 Jun 2019 22:00:38 -0400 Subject: [PATCH] remove unused test file --- .../corb/PostBatchUpdateJsonFileTaskTest.java | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 src/test/java/com/marklogic/developer/corb/PostBatchUpdateJsonFileTaskTest.java diff --git a/src/test/java/com/marklogic/developer/corb/PostBatchUpdateJsonFileTaskTest.java b/src/test/java/com/marklogic/developer/corb/PostBatchUpdateJsonFileTaskTest.java deleted file mode 100644 index f4cd4290..00000000 --- a/src/test/java/com/marklogic/developer/corb/PostBatchUpdateJsonFileTaskTest.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.marklogic.developer.corb; - -import org.junit.Test; -import org.w3c.dom.Document; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.List; -import java.util.Scanner; - -public class PostBatchUpdateJsonFileTaskTest { - - /* - @Test - public void writeBottomContent() throws IOException { - File test = File.createTempFile("foo","txt"); - test.deleteOnExit(); - try ( - BufferedWriter writer = new BufferedWriter(new FileWriter(test, false))) { - String line; - writer.write("["); - writer.newLine(); - writer.write("{foo: 1},"); - writer.newLine(); - writer.write("{foo: 2}"); - writer.newLine(); - writer.flush(); - } - //System.out.println(TestUtils.readFile(test)); - System.setProperty("EXPORT-FILE-BOTTOM-CONTENT", "]"); - System.setProperty("EXPORT-FILE-NAME", test.getAbsolutePath()); - //System.setProperty("EXPORT-FILE-DIR", test.getParentFile().getAbsolutePath()); - PostBatchUpdateJsonFileTask puf = new PostBatchUpdateJsonFileTask(); - puf.writeBottomContent(); - - System.out.println(TestUtils.readFile(test)); - } - - @Test - public void parseFile() throws Exception { - File file = new File("/tmp/test.xml"); - - parseFile(file, "Product"); - } -*/ - public static void main(String args[]) throws ParserConfigurationException, IOException { - File file = new File("/tmp/test.xml"); - parseFile(file, "Product"); - } - - public static void parseFile(File file, String elementName) - throws ParserConfigurationException, IOException{ - List good = new ArrayList<>(); - List bad = new ArrayList<>(); - - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder; - StringBuilder buffer = new StringBuilder(); - String line; - boolean append = false; - - try (Scanner scanner = new Scanner(file)){ - while (scanner.hasNextLine()) { - line = scanner.nextLine(); - if (line.startsWith('<' + elementName)) { - //start accumulating content - append = true; - } else if (line.startsWith("