All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ecfeed.junit.EcFeedResultVerifier Maven / Gradle / Ivy

Go to download

An open library used to connect to the ecFeed service. It can be also used as a standalone testing tool. It is integrated with Junit5 and generates a stream of test cases using a selected algorithm (e.g. Cartesian, N-Wise). There are no limitations associated with the off-line version but the user cannot access the on-line computation servers and the model database.

The newest version!
package com.ecfeed.junit;

import java.util.Optional;

import org.junit.jupiter.api.extension.AfterTestExecutionCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ExtensionContext.Namespace;

import com.ecfeed.core.genservice.schema.RequestUpdateErrorSchema;

public class EcFeedResultVerifier implements AfterTestExecutionCallback {

	@Override
	public void afterTestExecution(ExtensionContext context) throws Exception {
		Optional throwable = context.getExecutionException();
		
		EcFeedExtensionStore store = (EcFeedExtensionStore) context.getStore(Namespace.create("ecFeed")).get("ecFeedStore");

		if (store.getCollectStats()) {
			if (throwable.isPresent()) {
				RequestUpdateErrorSchema error = new RequestUpdateErrorSchema();

				error.setId(store.getTestId());
				error.setErrorClass(throwable.get().getClass() + "");
				error.setErrorMessage(throwable.get().getMessage());
				
				store.updateTestResults(error);
			}
		}

	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy