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

org.meanbean.test.VerifierSettings Maven / Gradle / Ivy

Go to download

Mean Bean is an open source Java test library that tests equals and hashCode contract compliance, as well as JavaBean/POJO getter and setter methods.

The newest version!
package org.meanbean.test;

import com.github.meanbeanlib.mirror.SerializableLambdas.SerializableFunction1;
import org.meanbean.bean.info.BeanInformationFactory;
import org.meanbean.factories.FactoryCollection;
import org.meanbean.factories.util.FactoryLookupStrategy;
import org.meanbean.lang.Factory;
import org.meanbean.util.RandomValueGenerator;

/**
 * @see BeanVerifier
 * @see BeanTesterBuilder
 * @see Configuration
 */
public interface VerifierSettings {

	RandomValueGenerator getRandomValueGenerator();

	VerifierSettings setRandomValueGenerator(RandomValueGenerator randomValueGenerator);

	FactoryCollection getFactoryCollection();

	VerifierSettings setFactoryCollection(FactoryCollection factoryCollection);

	FactoryLookupStrategy getFactoryLookupStrategy();

	VerifierSettings setFactoryLookupStrategy(FactoryLookupStrategy factoryLookupStrategy);

	BeanInformationFactory getBeanInformationFactory();

	VerifierSettings setBeanInformationFactory(BeanInformationFactory beanInformationFactory);

	/**
	 * Register a custom factory for given class
	 */
	 VerifierSettings registerFactory(Class clazz, Factory factory);

	/**
	 * Register factory for an inheritance type hierarchy
	 */
	 VerifierSettings registerTypeHierarchyFactory(Class baseType, Factory factory);

	int getDefaultIterations();

	/**
	 * Set the number of times a type should be tested by default
	 */
	VerifierSettings setDefaultIterations(int iterations);

    VerifierSettingsEditor suppressWarning(Warning warning);

    /**
     * Mark the specified property as one to be disregarded/ignored during testing.
     */
    VerifierSettings addIgnoredPropertyName(String property) throws IllegalArgumentException;

	/**
	 * Mark the specified property as one to be disregarded/ignored during testing.
	 * 
	 *     addIgnoredProperty(MyBean::getPropertyValue);
	 * 
*/ VerifierSettings addIgnoredProperty(SerializableFunction1 beanGetter) throws IllegalArgumentException; /** * Register the specified Factory as an override Factory for the specified property. This means that the specified * Factory will be used over the standard Factory for the property. */ VerifierSettings addOverrideFactory(String property, Factory factory) throws IllegalArgumentException; /** * Register the specified Factory as an override Factory for the specified property. This means that the specified * Factory will be used over the standard Factory for the property. *
	 *     addOverridePropertyFactory(MyBean::getPropertyValue, () -> createPropertyValue());
	 * 
*/ VerifierSettings addOverridePropertyFactory(SerializableFunction1 beanGetter, Factory factory); /** * Add a property that is insignificant for EqualsMethodTester */ VerifierSettings addEqualsInsignificantProperty(String propertyName); /** * Add a property that is insignificant for EqualsMethodTester * *
	 *     addEqualsInsignificantProperty(MyBean::getPropertyValue);
	 * 
*/ VerifierSettings addEqualsInsignificantProperty(SerializableFunction1 beanGetter); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy