<commit_before>package nl.nn.adapterframework.jdbc.transformer;

import nl.nn.adapterframework.stream.Message;
import nl.nn.adapterframework.testutil.TestFileUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.xml.sax.SAXException;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

@RunWith(Parameterized.class)
public class ToMap {
	private final static String FOLDER = "/Jdbc.transformer/";
	private final static String SRC = "src/test/resources" + FOLDER;
	private File xmlFile, expectedFile;

	public ToMap(File xmlFile, File expectedFile) {
		this.xmlFile = xmlFile;
		this.expectedFile = expectedFile;
	}

	@Parameterized.Parameters
	public static Collection<Object[]> data() {
		List<Object[]> files = new ArrayList<>();
		int i = 0;
		File xml = new File(SRC, i + ".xml");
		File json = new File(SRC, i + ".map");
		System.out.println(xml.getAbsolutePath());
		while (xml.exists() && json.exists()) {
			System.out.println(String.format("Added [%s] and [%s]", xml.getName(), json.getName()));
			files.add(new File[] {xml, json});
			i++;
			xml = new File(SRC, i + ".xml");
			json = new File(SRC, i + ".map");
		}

		return files;
	}

	@Test
	public void doTest() throws IOException, SAXException {
		String expected = TestFileUtils.getTestFile(FOLDER + expectedFile.getName());
		ObjectMapper mapper = new ObjectMapper();


		QueryOutputToMap transformer = new QueryOutputToMap();
		List<Map<String, String>> output = transformer.parseMessage(new Message(xmlFile));
		String out = mapper.writeValueAsString(output);

		Assert.assertEquals(expected, out);
	}
}<commit_msg>Remove org.codehaus.jackson.map.ObjectMapper import (#724)<commit_after>package nl.nn.adapterframework.jdbc.transformer;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.xml.sax.SAXException;

import com.fasterxml.jackson.databind.ObjectMapper;

import nl.nn.adapterframework.stream.Message;
import nl.nn.adapterframework.testutil.TestFileUtils;

@RunWith(Parameterized.class)
public class ToMap {
	private final static String FOLDER = "/Jdbc.transformer/";
	private final static String SRC = "src/test/resources" + FOLDER;
	private File xmlFile, expectedFile;

	public ToMap(File xmlFile, File expectedFile) {
		this.xmlFile = xmlFile;
		this.expectedFile = expectedFile;
	}

	@Parameterized.Parameters
	public static Collection<Object[]> data() {
		List<Object[]> files = new ArrayList<>();
		int i = 0;
		File xml = new File(SRC, i + ".xml");
		File json = new File(SRC, i + ".map");
		System.out.println(xml.getAbsolutePath());
		while (xml.exists() && json.exists()) {
			System.out.println(String.format("Added [%s] and [%s]", xml.getName(), json.getName()));
			files.add(new File[] {xml, json});
			i++;
			xml = new File(SRC, i + ".xml");
			json = new File(SRC, i + ".map");
		}

		return files;
	}

	@Test
	public void doTest() throws IOException, SAXException {
		String expected = TestFileUtils.getTestFile(FOLDER + expectedFile.getName());
		ObjectMapper mapper = new ObjectMapper();

		QueryOutputToMap transformer = new QueryOutputToMap();
		List<Map<String, String>> output = transformer.parseMessage(new Message(xmlFile));
		String out = mapper.writeValueAsString(output);

		Assert.assertEquals(expected, out);
	}
}
{'fraction_non_alphanumeric': 0.13855748373101953, 'fraction_numerical': 0.0013557483731019523, 'mean_word_length': 4.883572567783094, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 29}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5937187', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1164, 'n_words': 283}