<commit_before>package test;

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

import aQute.bnd.build.Workspace;
import aQute.bnd.build.WorkspaceRepository;
import aQute.bnd.service.RepositoryPlugin.Strategy;
import aQute.libg.version.Version;
import junit.framework.TestCase;

public class WorkspaceRepositoryTest extends TestCase {
	private WorkspaceRepository repo;
	
	public void setUp() throws Exception {
		Workspace workspace = Workspace.getWorkspace("test/ws");
		repo = new WorkspaceRepository(workspace);
	}
	
	public void testListNoFilter() throws Exception {
		List<String> files = repo.list(null);
		assertNotNull(files);
		assertTrue(files.size() > 0);
	}
	
	public void testListBsn() throws Exception {
		List<String> files = repo.list("p1");
		assertNotNull(files);
		assertTrue(files.size() > 0);
	}
	
	public void testListBsnForSubProject() throws Exception {
		List<String> files = repo.list("p4-sub.a");
		assertNotNull(files);
		assertTrue(files.size() > 0);
	}
	
	public void testListNotExisting() throws Exception {
		List<String> files = repo.list("somenotexistingproject");
		assertNotNull(files);<commit_msg>Made a copy of the workspace before testing. Tests should be merged so it runs faster. Without a copy, the workspace is modified due to builds that are performed<commit_after>package test;

import java.io.*;
import java.util.*;

import junit.framework.*;
import aQute.bnd.build.*;
import aQute.bnd.service.RepositoryPlugin.Strategy;
import aQute.lib.io.*;
import aQute.libg.version.*;

public class WorkspaceRepositoryTest extends TestCase {
	private WorkspaceRepository repo;
	
	public void setUp() throws Exception {
		File tmp = new File("tmp-ws");
		if (tmp.exists())
			IO.deleteWithException(tmp);
		tmp.mkdir();
		assertTrue(tmp.isDirectory());
		IO.copy(new File("test/ws"), tmp);

		Workspace workspace = Workspace.getWorkspace(tmp);
		repo = new WorkspaceRepository(workspace);
	}
	
	public void tearDown() throws Exception {
		IO.deleteWithException(new File("tmp-ws"));
	}
	
	public void testListNoFilter() throws Exception {
		List<String> files = repo.list(null);
		assertNotNull(files);
		assertTrue(files.size() > 0);
	}
	
	public void testListBsn() throws Exception {
		List<String> files = repo.list("p1");
		assertNotNull(files);
		assertTrue(files.size() > 0);
	}
	
	public void testListBsnForSubProject() throws Exception {
		List<String> files = repo.list("p4-sub.a");
		assertNotNull(files);
		assertTrue(files.size() > 0);
	}
	
	public void testListNotExisting() throws Exception {
		List<String> files = repo.list("somenotexistingproject");
		assertNotNull(files);
{'fraction_non_alphanumeric': 0.12180221458571974, 'fraction_numerical': 0.0038182512409316535, 'mean_word_length': 5.107226107226107, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '3400479', 'n_tokens_mistral': 853, 'n_tokens_neox': 800, 'n_words': 200}