<commit_before>package me.coley.recaf;

import com.google.common.primitives.Bytes;
import com.sun.jdi.DoubleValue;
import com.sun.jdi.Value;
import com.sun.jdi.request.*;
import me.coley.recaf.debug.*;
import me.coley.recaf.util.StringUtil;
import me.coley.recaf.workspace.*;
import org.junit.jupiter.api.*;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;

import static org.junit.jupiter.api.Assertions.*;

/**
 * Tests for using {@link VMWrap} implementations.
 *
 * @author Matt
 */
public class DebugTest extends Base {
	private static final long FAIL_TIMEOUT_SECONDS = 4;
	private DebuggerResource resource;
	private OutWrapper out;
	private VMWrap vm;

	@BeforeEach
	public void setup() {
		try {
			// The debugger resource is simply backed by another resource since the JDI doesn't
			// allow direct class lookups like instrumentation does.
			File file = getClasspathFile("calc.jar");
			JavaResource backing = new JarResource(file);
			// Specify main, classpath, suspend-on-launch
			vm = VMWrap.launching("Start", "-cp \"" + file.getAbsolutePath() + "\"", true);
			resource = vm.toResource(backing);
			resource.getVm().setup(out = new OutWrapper());
		} catch(Exception ex) {
			fail(ex);
		}
	}

	@Test<commit_msg>Disable DebugTest, feature is on hold<commit_after>package me.coley.recaf;

import com.google.common.primitives.Bytes;
import com.sun.jdi.DoubleValue;
import com.sun.jdi.Value;
import com.sun.jdi.request.*;
import me.coley.recaf.debug.*;
import me.coley.recaf.util.StringUtil;
import me.coley.recaf.workspace.*;
import org.junit.jupiter.api.*;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;

import static org.junit.jupiter.api.Assertions.*;

/**
 * Tests for using {@link VMWrap} implementations.
 *
 * @author Matt
 */
@Disabled
// TODO: These tests are flaky and can fail intermittently
public class DebugTest extends Base {
	private static final long FAIL_TIMEOUT_SECONDS = 4;
	private DebuggerResource resource;
	private OutWrapper out;
	private VMWrap vm;

	@BeforeEach
	public void setup() {
		try {
			// The debugger resource is simply backed by another resource since the JDI doesn't
			// allow direct class lookups like instrumentation does.
			File file = getClasspathFile("calc.jar");
			JavaResource backing = new JarResource(file);
			// Specify main, classpath, suspend-on-launch
			vm = VMWrap.launching("Start", "-cp \"" + file.getAbsolutePath() + "\"", true);
			resource = vm.toResource(backing);
			resource.getVm().setup(out = new OutWrapper());
		} catch(Exception ex) {
			fail(ex);
		}
	}

	@Test
{'fraction_non_alphanumeric': 0.12394262596542846, 'fraction_numerical': 0.000735564545788893, 'mean_word_length': 4.240847784200385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6335010', 'n_tokens_mistral': 910, 'n_tokens_neox': 846, 'n_words': 228}