001package de.cuioss.test.jsf.config.component;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Repeatable;
005import java.lang.annotation.Retention;
006import java.lang.annotation.RetentionPolicy;
007import java.lang.annotation.Target;
008import java.util.Collection;
009
010import javax.el.ValueExpression;
011
012import de.cuioss.test.jsf.component.AbstractComponentTest;
013import de.cuioss.test.valueobjects.api.property.PropertyConfig;
014import de.cuioss.test.valueobjects.property.PropertyMetadata;
015import de.cuioss.test.valueobjects.property.util.AssertionStrategy;
016
017/**
018 * If used on {@link AbstractComponentTest} type configures the property-tests.
019 * <p>
020 * In essence it checks the getters and setters. As default it assumes the
021 * individual properties to not provide a default value. This can be controlled
022 * using {@link #defaultValued()}
023 * <p>
024 *
025 * @author Oliver Wolff
026 */
027@Repeatable(VerifyComponentPropertiesRepeat.class)
028@Retention(RetentionPolicy.RUNTIME)
029@Target({ ElementType.TYPE })
030public @interface VerifyComponentProperties {
031
032    /**
033     * @return a number of properties, identified by their names that are to be
034     *         considered for this test: white-list
035     */
036    String[] of() default {};
037
038    /**
039     * @return a number of properties, identified by their names that are to be
040     *         treated as having a default values, see
041     *         {@link PropertyMetadata#isDefaultValue()}
042     */
043    String[] defaultValued() default {};
044
045    /**
046     * @return a number of properties, identified by their names that are to be
047     *         ignore on the tests with {@link ValueExpression}s. <em>Caution</em>
048     *         the need of the configuration hints on an invalid implementation,
049     *         because all properties should consider {@link ValueExpression}s.
050     */
051    String[] noValueExpression() default {};
052
053    /**
054     * @return a number of properties, identified by their names representing at
055     *         least a {@link Collection} that are to be asserted ignoring the
056     *         concrete order, see {@link PropertyConfig#assertionStrategy()} and
057     *         {@link AssertionStrategy#COLLECTION_IGNORE_ORDER}. The default
058     *         implementation will always respect / assert the same order of
059     *         elements.
060     */
061    String[] assertUnorderedCollection() default {};
062}