<commit_before>package org.lockss.plugin.clockss.jemds;

import org.apache.commons.io.FileUtils;
import org.lockss.daemon.PluginException;
import org.lockss.daemon.ShouldNotHappenException;
import org.lockss.extractor.*;
import org.lockss.plugin.ArchivalUnit;
import org.lockss.plugin.CachedUrl;
import org.lockss.plugin.clockss.JatsPublishingSchemaHelper;
import org.lockss.plugin.clockss.SourceXmlMetadataExtractorFactory;
import org.lockss.plugin.clockss.SourceXmlMetadataExtractorTest;
import org.lockss.plugin.clockss.SourceXmlSchemaHelper;
import org.lockss.util.Constants;
import org.lockss.util.Logger;
import org.w3c.dom.Document;

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

public class TestJournalofEvolutionMedicalDentalSciencesJatsXmlXpathMetadataExtractor extends SourceXmlMetadataExtractorTest {

    private static final Logger log = Logger.getLogger(TestJournalofEvolutionMedicalDentalSciencesJatsXmlXpathMetadataExtractor.class);

    private static String BaseUrl = "http://source.host.org/sourcefiles/jemds/";
    private static String Directory = "2019";

    private static String getXmlFileContent(String fname) {
        String xmlContent = "";
        try {
            String currentDirectory = System.getProperty("user.dir");
            String pathname = currentDirectory +
                    "/plugins/test/src/org/lockss/plugin/clockss/jemds/" + fname;
            xmlContent = FileUtils.readFileToString(new File(pathname), Constants.DEFAULT_ENCODING);


        } catch(IOException e) {
            log.error(e.getMessage(), e);
        }
        return xmlContent;<commit_msg>update test to use getResourceAsStream function<commit_after>package org.lockss.plugin.clockss.jemds;

import org.lockss.daemon.PluginException;
import org.lockss.daemon.ShouldNotHappenException;
import org.lockss.extractor.*;
import org.lockss.plugin.ArchivalUnit;
import org.lockss.plugin.CachedUrl;
import org.lockss.plugin.clockss.JatsPublishingSchemaHelper;
import org.lockss.plugin.clockss.SourceXmlMetadataExtractorFactory;
import org.lockss.plugin.clockss.SourceXmlMetadataExtractorTest;
import org.lockss.plugin.clockss.SourceXmlSchemaHelper;
import org.lockss.util.IOUtil;
import org.lockss.util.Logger;
import org.lockss.util.StringUtil;
import org.w3c.dom.Document;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

public class TestJournalofEvolutionMedicalDentalSciencesJatsXmlXpathMetadataExtractor extends SourceXmlMetadataExtractorTest {

    private static final Logger log = Logger.getLogger(TestJournalofEvolutionMedicalDentalSciencesJatsXmlXpathMetadataExtractor.class);

    private static String BaseUrl = "http://source.host.org/sourcefiles/jemds/";
    private static String Directory = "2019";

    private String getXmlFileContent(String fname) {
        String xmlContent = "";
        InputStream file_input = null;

        try {
            file_input = getResourceAsStream(fname);
            xmlContent = StringUtil.fromInputStream(file_input);
            IOUtil.safeClose(file_input);
        } catch (IOException e) {
            log.error(e.getMessage(), e);
        } finally {
            IOUtil.safeClose(file_input);
        }
        return xmlContent;
{'fraction_non_alphanumeric': 0.08975903614457831, 'fraction_numerical': 0.0030120481927710845, 'mean_word_length': 4.365105008077545, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '2660298', 'n_tokens_mistral': 972, 'n_tokens_neox': 958, 'n_words': 168}