<commit_before>/*-
 * #%L
 * ELK Reasoner Core
 * $Id:$
 * $HeadURL:$
 * %%
 * Copyright (C) 2011 - 2016 Department of Computer Science, University of Oxford
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package org.semanticweb.elk.reasoner.incremental;

import org.junit.Ignore;
import org.junit.Test;
import org.semanticweb.elk.testing.TestInput;
import org.semanticweb.elk.testing.TestManifest;
import org.semanticweb.elk.testing.TestOutput;

public abstract class IncrementalReasoningCorrectnessTestWithInterrupts<I extends TestInput, A, EO extends TestOutput, AO extends TestOutput, TD extends IncrementalReasoningTestWithInterruptsDelegate<A, EO, AO>>
		extends BaseIncrementalReasoningCorrectnessTest<I, A, EO, AO, TD> {

	public IncrementalReasoningCorrectnessTestWithInterrupts(
			final TestManifest<I> testManifest, final TD testDelegate) {
		super(testManifest, testDelegate);
	}

	@Test
	@Ignore
	public void incrementalReasoningWithInterrupts() throws Exception {
		load();

		delegate_.initWithInterrupts();

		run(new CheckerWithInterrupts());
	}

	protected class CheckerWithInterrupts extends OutputChecker {

		@Override
		public void check() throws Exception {
			AO actualOutput;
			try {
				actualOutput = delegate_.getActualOutput();
			} catch (final Exception e) {
				if (delegate_.getInterruptionExceptionClass().isInstance(e)) {
					return;
				}
				throw e;
			}
			correctnessCheck(actualOutput, delegate_.getExpectedOutput());
		}

		@Override
		public void finalCheck() throws Exception {
			AO actualOutput;
			while (true) {
				try {
					actualOutput = delegate_.getActualOutput();
				} catch (final Exception e) {
					if (delegate_.getInterruptionExceptionClass()
							.isInstance(e)) {
						continue;
					}
					throw e;
				}
				break;
			}
			correctnessCheck(actualOutput, delegate_.getExpectedOutput());
		}

	}

}<commit_msg>Complete interrupted call in incremental tests<commit_after>/*-
 * #%L
 * ELK Reasoner Core
 * $Id:$
 * $HeadURL:$
 * %%
 * Copyright (C) 2011 - 2016 Department of Computer Science, University of Oxford
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package org.semanticweb.elk.reasoner.incremental;

import org.junit.Ignore;
import org.junit.Test;
import org.semanticweb.elk.testing.TestInput;
import org.semanticweb.elk.testing.TestManifest;
import org.semanticweb.elk.testing.TestOutput;

public abstract class IncrementalReasoningCorrectnessTestWithInterrupts<I extends TestInput, A, EO extends TestOutput, AO extends TestOutput, TD extends IncrementalReasoningTestWithInterruptsDelegate<A, EO, AO>>
		extends BaseIncrementalReasoningCorrectnessTest<I, A, EO, AO, TD> {

	public IncrementalReasoningCorrectnessTestWithInterrupts(
			final TestManifest<I> testManifest, final TD testDelegate) {
		super(testManifest, testDelegate);
	}

	@Test
	public void completingIncrementalReasoningWithInterrupts()
			throws Exception {
		load();

		delegate_.initWithInterrupts();

		run(new CompletingCheckerWithInterrupts());
	}

	protected class CompletingCheckerWithInterrupts extends OutputChecker {

		@Override
		public void check() throws Exception {
			finalCheck();
		}

		@Override
		public void finalCheck() throws Exception {
			AO actualOutput;
			while (true) {
				try {
					actualOutput = delegate_.getActualOutput();
				} catch (final Exception e) {
					if (delegate_.getInterruptionExceptionClass()
							.isInstance(e)) {
						continue;
					}
					throw e;
				}
				break;
			}
			correctnessCheck(actualOutput, delegate_.getExpectedOutput());
		}

	}

	@Test
	@Ignore
	public void incrementalReasoningWithInterrupts() throws Exception {
		load();

		delegate_.initWithInterrupts();

		run(new NoncompletingCheckerWithInterrupts());
	}

	protected class NoncompletingCheckerWithInterrupts
			extends CompletingCheckerWithInterrupts {

		@Override
		public void check() throws Exception {
			AO actualOutput;
			try {
				actualOutput = delegate_.getActualOutput();
			} catch (final Exception e) {
				if (delegate_.getInterruptionExceptionClass().isInstance(e)) {
					return;
				}
				throw e;
			}
			correctnessCheck(actualOutput, delegate_.getExpectedOutput());
		}

	}

}
{'fraction_non_alphanumeric': 0.08964067278287462, 'fraction_numerical': 0.0045871559633027525, 'mean_word_length': 4.196623634558093, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4746407', 'n_tokens_mistral': 1745, 'n_tokens_neox': 1488, 'n_words': 441}