<commit_before>package hu.eltesoft.modelexecution.runtime.mocks;

import hu.eltesoft.modelexecution.runtime.InstanceRegistry;
import hu.eltesoft.modelexecution.runtime.Runtime;
import hu.eltesoft.modelexecution.runtime.base.ClassWithState;
import hu.eltesoft.modelexecution.runtime.base.Event;
import hu.eltesoft.modelexecution.runtime.base.SignalEvent;
import hu.eltesoft.modelexecution.runtime.base.StateMachineRegion;

public class MockClass extends ClassWithState {

	private static MockClass instance = null;

	private Runtime runtime;

	public static MockClass create(Runtime runtime) {
		return new MockClass(runtime);
	}

	public MockClass(Runtime runtime) {
		super(runtime, 0);
		this.runtime = runtime;
		instance = this;
		InstanceRegistry.getInstanceRegistry().registerInstance(this);
	}

	public static void emptyFeed() {
		instance.dispose();
	}

	public void feedEvent() {
		runtime.addEventToQueue(this, new SignalEvent(new DummySignal()));
		// do not dispose the instance here as it will be
		// unregistered before entering the event loop
	}

	@Override
	public void init() {
	}

	@Override
	public void receive(Event event) {
		// dispose the instance after the event is delivered
		// to let the dispatch loop terminate
		dispose();
	}

	@Override
	public boolean equals(Object obj) {
		return (obj != null && obj instanceof MockClass);
	}

	@Override
	protected StateMachineRegion createStateMachine() {
		// do not need a state machine since receive and init is overridden
		return null;
	}
}<commit_msg>actionCode: fixing runtime tests according to the previous commit<commit_after>package hu.eltesoft.modelexecution.runtime.mocks;

import hu.eltesoft.modelexecution.runtime.InstanceRegistry;
import hu.eltesoft.modelexecution.runtime.Runtime;
import hu.eltesoft.modelexecution.runtime.base.ClassWithState;
import hu.eltesoft.modelexecution.runtime.base.Event;
import hu.eltesoft.modelexecution.runtime.base.SignalEvent;
import hu.eltesoft.modelexecution.runtime.base.StateMachineRegion;

public class MockClass extends ClassWithState {

	private static MockClass instance = null;

	private Runtime runtime;

	public static MockClass create(Runtime runtime) {
		return new MockClass(runtime);
	}

	public MockClass(Runtime runtime) {
		super(runtime, 0);
		this.runtime = runtime;
		instance = this;
		InstanceRegistry.getInstanceRegistry().registerInstance(this);
	}

	public static void emptyFeed() {
		instance.dispose();
	}

	public void feedEvent() {
		runtime.addEventToQueue(this, new SignalEvent(new DummySignal()));
		// do not dispose the instance here as it will be
		// unregistered before entering the event loop
	}

	@Override
	public void receive(Event event) {
		// dispose the instance after the event is delivered
		// to let the dispatch loop terminate
		dispose();
	}

	@Override
	public boolean equals(Object obj) {
		return (obj != null && obj instanceof MockClass);
	}

	@Override
	protected StateMachineRegion createStateMachine() {
		// do not need a state machine since receive and init is overridden
		return null;
	}
}
{'fraction_non_alphanumeric': 0.08726799088244871, 'fraction_numerical': 0.0006512536633018561, 'mean_word_length': 4.829222011385199, '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': '3322226', 'n_tokens_mistral': 956, 'n_tokens_neox': 877, 'n_words': 256}