<commit_before>package esg.security.utils.ssl;

import static org.junit.Assert.fail;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import esg.security.utils.ssl.exceptions.HttpsClientInitException;
import esg.security.utils.ssl.exceptions.HttpsClientRetrievalException;
import esg.security.utils.ssl.HttpsClient;


public class HttpsClientTest {

	public final static String PROPERTIES_FILE = "https-client-test.properties";
	public final static String TEST01_URI = "test01.uri";
	public final static String TEST02_URI = "test02.uri";
	public final static String URI = "https://pcmdi3.llnl.gov";
	protected final static Log LOG = LogFactory.getLog(HttpsClientTest.class);
	protected Properties props = null;
	
	@Before
	public void beforeSetup() throws IOException {
		InputStream propertiesFile = this.getClass().getResourceAsStream(PROPERTIES_FILE);
		
    	props = new Properties();
		props.load(propertiesFile);		<commit_msg>chg: set the property of truststore location dynamically<commit_after>package esg.security.utils.ssl;

import static org.junit.Assert.fail;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import esg.security.utils.ssl.exceptions.HttpsClientInitException;
import esg.security.utils.ssl.exceptions.HttpsClientRetrievalException;


public class HttpsClientTest {

	public final static String PROPERTIES_FILE = "https-client-test.properties";
	public final static String TRUSTSTORE_FILE = "https-client-test-truststore.ks";
	public final static String TEST01_URI = "test01.uri";
	public final static String TEST02_URI = "test02.uri";
	public final static String URI = "https://pcmdi3.llnl.gov";
	protected final static Log LOG = LogFactory.getLog(HttpsClientTest.class);
	protected Properties props = null;
	
	@Before
	public void beforeSetup() throws IOException {
		InputStream propertiesFile = this.getClass().getResourceAsStream(PROPERTIES_FILE);
		
    	props = new Properties();
		props.load(propertiesFile);
		
		//Find the file from this classloader and put the path in the proper variable
		props.put("esg.security.utils.ssl.DnWhitelistX509TrustMgr.trustStoreFilePath", 
		        this.getClass().getResource(TRUSTSTORE_FILE).getFile());
		
{'fraction_non_alphanumeric': 0.09755164498852334, 'fraction_numerical': 0.008033664881407804, 'mean_word_length': 5.378048780487805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2765830', 'n_tokens_mistral': 814, 'n_tokens_neox': 776, 'n_words': 185}