<commit_before>package eu.hohenegger.modulebuilder;

import static eu.hohenegger.modulebuilder.ModuleUtil.generateModule;
import static org.eclipse.emf.common.util.Diagnostic.OK;
import static org.junit.Assert.assertTrue;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.util.Diagnostician;
import org.junit.Before;
import org.junit.Test;

import modulespecification.Module;
import modulespecification.ModulespecificationFactory;

public class ModuleUtilTest {

	private Module module;
	private NullProgressMonitor monitor;

	@Before
	public void setup() {
		module = createModel("TODO");
		monitor = new NullProgressMonitor();
	}

	private Module createModel(String pluginId) {
		Module module = ModulespecificationFactory.eINSTANCE.createModule();
		module.setBaseId(pluginId);

		return module;
	}

	@Test
	public void testGenerateJavaProject() {
		Diagnostic diagnostic = Diagnostician.INSTANCE.validate(module);
		assertTrue(diagnostic.getSeverity() == OK);

		generateModule(module, monitor);

		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
		IProject project = root.getProject(module.getBaseId());
		assertTrue(project.exists());
	}
}<commit_msg>Extended tests<commit_after>package eu.hohenegger.modulebuilder;

import static eu.hohenegger.modulebuilder.ModuleUtil.generateModule;
import static org.eclipse.emf.common.util.Diagnostic.OK;
import static org.junit.Assert.assertTrue;

import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.util.Diagnostician;
import org.junit.Before;
import org.junit.Test;

import modulespecification.Module;
import modulespecification.ModulespecificationFactory;

public class ModuleUtilTest {

	private Module module;
	private NullProgressMonitor monitor;

	@Before
	public void setup() {
		module = createModel("TODO");
		monitor = new NullProgressMonitor();
	}

	private Module createModel(String pluginId) {
		Module module = ModulespecificationFactory.eINSTANCE.createModule();
		module.setBaseId(pluginId);

		return module;
	}

	@Test
	public void testGenerateJavaProject() {
		Diagnostic diagnostic = Diagnostician.INSTANCE.validate(module);
		assertTrue(diagnostic.getSeverity() == OK);

		generateModule(module, monitor);

		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
		assertTrue(root.getProject(module.getCoreId()).exists());
		assertTrue(root.getProject(module.getFeatureId()).exists());
		assertTrue(root.getProject(module.getUpdateSiteId()).exists());
		assertTrue(root.getProject(module.getTargetId()).exists());
		assertTrue(root.getProject(module.getUiId()).exists());
	}
}
{'fraction_non_alphanumeric': 0.11002691790040377, 'fraction_numerical': 0.0, 'mean_word_length': 6.469849246231155, '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': '1698553', 'n_tokens_mistral': 884, 'n_tokens_neox': 864, 'n_words': 154}