<commit_before>package org.adligo.i.log.client;

import java.util.HashMap;

import junit.framework.TestCase;

import org.adligo.i.util.client.I_Map;
import org.adligo.j2se.util.MapWrapper;

public class SimpleLogTests extends TestCase implements I_LogOutput {
	private String currentLog = "";
	private String newMessage = "";
	private String errTrace = " <java.lang.Exception: Ex>\n" +
	 	"\t at org.adligo.i.log.client.SimpleLogTests.setUp(SimpleLogTests.java:32)\n"+
		"\t at junit.framework.TestCase.runBare(TestCase.java:128)\n"+
		"\t at junit.framework.TestResult$1.protect(TestResult.java:106)\n"+
		"\t at junit.framework.TestResult.runProtected(TestResult.java:124)\n"+
		"\t at junit.framework.TestResult.run(TestResult.java:109)\n"+
		"\t at junit.framework.TestCase.run(TestCase.java:120)\n"+
		"\t at junit.framework.TestSuite.runTest(TestSuite.java:230)\n"+
		"\t at junit.framework.TestSuite.run(TestSuite.java:225)\n"+
		"\t at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)\n"+
		"\t at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)\n"+
		"\t at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)\n"+
		"\t at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)\n"+
		"\t at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)\n"+
		"\t at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)\n";
	private Exception x = null;
	
	public void setUp() {
		try {
			 Exception t = new Exception("Ex");
			 throw t;
		} catch (Exception y) {
			x = y;
		}
	}
	
	@Override
	public void write(String p) {
		newMessage = p;
		assertEquals("Sould match", currentLog,p);
	}

	public void testOutputs() {
		SimpleLog.setOut(this);
		
		SimpleLog log = new SimpleLog("TestLog", new MapWrapper(new HashMap()));
		log.setLevel(I_LogDelegate.LOG_LEVEL_FATAL);
		assertFatal(log);
		log.setLevel(I_LogDelegate.LOG_LEVEL_ERROR);
		assertError(log);
		log.setLevel(I_LogDelegate.LOG_LEVEL_WARN);
		assertWarn(log);
		log.setLevel(I_LogDelegate.LOG_LEVEL_INFO);
		assertInfo(log);
		log.setLevel(I_LogDelegate.LOG_LEVEL_DEBUG);
		assertDebug(log);
		log.setLevel(I_LogDelegate.LOG_LEVEL_TRACE);<commit_msg>error was screwing up when getting run from ant/junit runner<commit_after>package org.adligo.i.log.client;

import java.util.HashMap;

import junit.framework.TestCase;

import org.adligo.i.util.client.I_Map;
import org.adligo.j2se.util.MapWrapper;

public class SimpleLogTests extends TestCase implements I_LogOutput {
	private String currentLog = "";
	private String newMessage = "";
	private String errTrace;
	private Exception x = null;
	
	public void setUp() {
		try {
			 Exception t = new Exception("Ex");
			 throw t;
		} catch (Exception y) {
			x = y;
		}
		
		StackTraceElement[] elements = x.getStackTrace();
		StringBuffer sb = new StringBuffer();
		sb.append(" <java.lang.Exception: Ex>\n");
		for (int i = 0; i < elements.length; i++) {
			sb.append("\t at ");
			sb.append(elements[i].toString());
			sb.append("\n");
		}
		errTrace = sb.toString();
	}
	
	@Override
	public void write(String p) {
		newMessage = p;
		assertEquals("Sould match", currentLog,p);
	}

	public void testOutputs() {
		SimpleLog.setOut(this);
		
		SimpleLog log = new SimpleLog("TestLog", new MapWrapper(new HashMap()));
		log.setLevel(I_LogDelegate.LOG_LEVEL_FATAL);
		assertFatal(log);
		log.setLevel(I_LogDelegate.LOG_LEVEL_ERROR);
		assertError(log);
		log.setLevel(I_LogDelegate.LOG_LEVEL_WARN);
		assertWarn(log);
		log.setLevel(I_LogDelegate.LOG_LEVEL_INFO);
		assertInfo(log);
		log.setLevel(I_LogDelegate.LOG_LEVEL_DEBUG);
		assertDebug(log);
		log.setLevel(I_LogDelegate.LOG_LEVEL_TRACE);
{'fraction_non_alphanumeric': 0.13986928104575164, 'fraction_numerical': 0.012287581699346406, 'mean_word_length': 4.814589665653496, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '3513447', 'n_tokens_mistral': 1448, 'n_tokens_neox': 1323, 'n_words': 229}