<commit_before>/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.test.docker.junit5;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.extension.ExtendWith;
import org.xwiki.test.docker.internal.junit5.TestReferenceParameterResolver;
import org.xwiki.test.docker.internal.junit5.XWikiDockerExtension;
import org.xwiki.test.docker.junit5.browser.Browser;
import org.xwiki.test.docker.junit5.database.Database;
import org.xwiki.test.docker.junit5.servletengine.ServletEngine;
import org.xwiki.test.integration.junit5.ValidateConsoleExtension;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Marks a test as being a functional UI Test.
 *
 * @version $Id$
 * @since 10.6RC1
 */
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
@ExtendWith(ValidateConsoleExtension.class)
@ExtendWith(XWikiDockerExtension.class)
@ExtendWith(TestReferenceParameterResolver.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public @interface UITest
{
    /**
     * @return the browser to use, see {@link Browser}
     */
    Browser browser() default Browser.FIREFOX;

    /**
     * @return the database to use, see {@link Database}
     * @since 10.9
     */
    Database database() default Database.HSQLDB_EMBEDDED;

    /**
     * @return the Servlet Engine to use, see {@link ServletEngine}
     * @since 10.9
     */
    ServletEngine servletEngine() default ServletEngine.JETTY_STANDALONE;

    /**
     * @return true if the test should output verbose console logs or not
     * @since 10.10RC1
     */
    boolean verbose() default false;

    /**
     * @return true if the test should output debug console logs or not
     * @since 10.11RC1
     */
    boolean debug() default false;

    /**
     * @return true if the database data should be mapped to a local directory on the host computer so that it can be
     * saved and reused for another run
     * @since 10.10RC1
     */
    boolean saveDatabaseData() default false;

    /**
     * @return true if the Maven resolving is done in offline mode (i.e. you need to have the required artifacts in your
     * local repository). False by default to avoid developer problems but should be set to true in the CI to improve
     * performance of functional tests
     * @since 10.10RC1
     */
    boolean offline() default false;

    /**
     * @return the docker image tag to use (if not specified, uses the "latest" tag)
     * @since 10.10RC1
     */
    String servletEngineTag() default "";

    /**
     * @return the docker image tag to use (if not specified, uses the default from TestContainers)
     * @since 10.10RC1
     */
    String databaseTag() default "";

    /**
     * @return the version of the JDBC driver to use for the selected database (if not specified, uses a default version
     * depending on the database)
     * @since 10.10RC1
     */
    String jdbcDriverVersion() default "";

    /**
     * @return true if VNC container is started and recording is done and saved on test exit
     * @since 10.10RC1
     */
    boolean vnc() default true;

    /**
     * @return the list of configuration properties to use when generating the XWiki configuration files such as as
     * {@code xwiki.properties} (check {@code xwiki.properties.vm} to find the list of supported properties)
     * @since 10.10RC1
     */
    String[] properties() default {};

    /**
     * @return the properties to overwrite in the generated extensions descriptors
     * @since 11.6RC1<commit_msg>XINFRA-297: Temporary failure in name resolution with VNC recorder on KS4<commit_after>/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.test.docker.junit5;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.extension.ExtendWith;
import org.xwiki.test.docker.internal.junit5.TestReferenceParameterResolver;
import org.xwiki.test.docker.internal.junit5.XWikiDockerExtension;
import org.xwiki.test.docker.junit5.browser.Browser;
import org.xwiki.test.docker.junit5.database.Database;
import org.xwiki.test.docker.junit5.servletengine.ServletEngine;
import org.xwiki.test.integration.junit5.ValidateConsoleExtension;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Marks a test as being a functional UI Test.
 *
 * @version $Id$
 * @since 10.6RC1
 */
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
@ExtendWith(ValidateConsoleExtension.class)
@ExtendWith(XWikiDockerExtension.class)
@ExtendWith(TestReferenceParameterResolver.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public @interface UITest
{
    /**
     * @return the browser to use, see {@link Browser}
     */
    Browser browser() default Browser.FIREFOX;

    /**
     * @return the database to use, see {@link Database}
     * @since 10.9
     */
    Database database() default Database.HSQLDB_EMBEDDED;

    /**
     * @return the Servlet Engine to use, see {@link ServletEngine}
     * @since 10.9
     */
    ServletEngine servletEngine() default ServletEngine.JETTY_STANDALONE;

    /**
     * @return true if the test should output verbose console logs or not
     * @since 10.10RC1
     */
    boolean verbose() default false;

    /**
     * @return true if the test should output debug console logs or not
     * @since 10.11RC1
     */
    boolean debug() default false;

    /**
     * @return true if the database data should be mapped to a local directory on the host computer so that it can be
     * saved and reused for another run
     * @since 10.10RC1
     */
    boolean saveDatabaseData() default false;

    /**
     * @return true if the Maven resolving is done in offline mode (i.e. you need to have the required artifacts in your
     * local repository). False by default to avoid developer problems but should be set to true in the CI to improve
     * performance of functional tests
     * @since 10.10RC1
     */
    boolean offline() default false;

    /**
     * @return the docker image tag to use (if not specified, uses the "latest" tag)
     * @since 10.10RC1
     */
    String servletEngineTag() default "";

    /**
     * @return the docker image tag to use (if not specified, uses the default from TestContainers)
     * @since 10.10RC1
     */
    String databaseTag() default "";

    /**
     * @return the version of the JDBC driver to use for the selected database (if not specified, uses a default version
     * depending on the database)
     * @since 10.10RC1
     */
    String jdbcDriverVersion() default "";

    /**
     * @return true if VNC container is started and recording is done and saved on test exit
     * @since 10.10RC1
     */
    boolean vnc() default false;

    /**
     * @return the list of configuration properties to use when generating the XWiki configuration files such as as
     * {@code xwiki.properties} (check {@code xwiki.properties.vm} to find the list of supported properties)
     * @since 10.10RC1
     */
    String[] properties() default {};

    /**
     * @return the properties to overwrite in the generated extensions descriptors
     * @since 11.6RC1
{'fraction_non_alphanumeric': 0.0870731455689673, 'fraction_numerical': 0.016713091922005572, 'mean_word_length': 3.434583714547118, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2022319', 'n_tokens_mistral': 2819, 'n_tokens_neox': 2650, 'n_words': 1011}