<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 1999-2010 <NAME> - LICENSE: Apache 2.0 -->
<project basedir="." default="compile" name="orientdb-tests">
    <property name="project.jar-classpath" value="orientdb-client-${version}.jar orientdb-client-${version}.jar"/>
    <property name="project.src" value="src/test/java"/>
    <property name="project.build" value="target/test-classes"/>

    <import file="../_base/base-build.xml"/>

    <taskdef resource="testngtasks" classpath="lib/testng.jar"/>

    <target name="test" depends="test-memory, test-local, test-local-lh, test-remote, test-remote-lh">
    </target>

    <target name="test-init">
        <copy todir="${project.build}">
            <fileset dir="src/test/java">
                <include name="**/*.xml"/>
            </fileset>
        </copy>

        <replace dir="${project.build}/com/orientechnologies/orient/test/database/auto">
            <include name="*-test-db-from-scratch.xml"/>

            <replacefilter token="@PATH@" value="${orient.path}/databases/demo"/>
            <replacefilter token="@URL@" value="local:${orient.path}/databases/demo"/>
        </replace>
    </target>

    <target name="test-memory" depends="test-init">
        <echo>EXECUTING TESTS USING MEMORY DATABASE: memory:demo</echo>
        <testng outputDir="target/test-output" haltOnFailure="true" verbose="2">
            <classpath>
                <pathelement location="${project.build}"/>
                <fileset dir="${global.lib}">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
            <xmlfileset dir="${project.build}/com/orientechnologies/orient/test/database/auto"
                        includes="memory-test-db-from-scratch.xml"/>
        </testng>
    </target>

    <target name="test-local" depends="test-init">
        <echo>EXECUTING TESTS USING LOCAL DATABASE: local:${orient.path}/databases/demo</echo>
        <testng outputDir="target/test-output" haltOnFailure="true" verbose="2">
            <classpath>
                <pathelement location="${project.build}"/>
                <fileset dir="${global.lib}">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
            <xmlfileset dir="${project.build}/com/orientechnologies/orient/test/database/auto"
                        includes="local-test-db-from-scratch.xml"/>
        </testng>
    </target>

    <target name="test-local-lh" depends="test-init">
        <echo>EXECUTING TESTS USING LOCAL DATABASE and LH data cluster: local:${orient.path}/databases/demo</echo>
        <testng outputDir="target/test-output" haltOnFailure="true" verbose="2">
            <jvmarg value="-Dfile.cluster.useLHPEPS=true"/>
            <classpath>
                <pathelement location="${project.build}"/>
                <fileset dir="${global.lib}">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
            <xmlfileset dir="${project.build}/com/orientechnologies/orient/test/database/auto"
                        includes="local-test-db-from-scratch.xml"/>
        </testng>
    </target>


    <target name="test-remote" depends="test-init">
        <echo>STARTING REMOTE ORIENTDB SERVER INSTANCE...</echo>
        <exec dir="../${orient.path}/bin" executable="cmd" spawn="true" osfamily="windows">
            <env key="JAVA_OPTS"
                 value="-Dcom.sun.management.jmxremote.port=4321 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" />
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="/c start server.bat"/>
        </exec>

        <exec dir="../${orient.path}/bin" executable="sh" spawn="true" osfamily="unix">
            <env key="JAVA_OPTS"
                 value="-Dcom.sun.management.jmxremote.port=4321 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" />
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="./server.sh"/>
        </exec>

        <echo>WAITING FOR SERVER STARTUP...</echo>
        <sleep seconds="5"/>

        <echo>EXECUTING TESTS USING REMOTE DATABASE: remote:localhost/demo</echo>
        <testng outputDir="target/test-output" haltOnFailure="true">
			<jvmarg value="-Dorientdb.config.file=${basedir}/src/test/resources/orientdb-server-config.xml"/>
            <classpath>
                <pathelement location="${project.build}"/>
                <fileset dir="${global.lib}">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
            <xmlfileset dir="${project.build}/com/orientechnologies/orient/test/database/auto"
                        includes="remote-test-db-from-scratch.xml"/>
        </testng>

        <echo>SHUTDOWNING THE SERVER...</echo>
        <exec dir="../${orient.path}/bin" executable="cmd" spawn="true" osfamily="windows">
            <arg value="/c shutdown.bat"/>
        </exec>

        <exec dir="../${orient.path}/bin" executable="sh" spawn="true" osfamily="unix">
            <arg value="./shutdown.sh"/>
        </exec>

        <sleep seconds="10"/>
    </target>

    <target name="test-remote-lh" depends="test-init" if="${fullTest}">
        <echo>STARTING REMOTE ORIENTDB SERVER INSTANCE WITH LH DATA CLUSTERS...</echo>
        <exec dir="../${orient.path}/bin" executable="cmd" spawn="true" osfamily="windows">
            <env key="JAVA_OPTS"
                 value="-Dcom.sun.management.jmxremote.port=4321 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dfile.cluster.useLHPEPS=true"/>
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="/c start server.bat"/>
        </exec>

        <exec dir="../${orient.path}/bin" executable="sh" spawn="true" osfamily="unix">
            <env key="JAVA_OPTS"
                 value="-Dcom.sun.management.jmxremote.port=4321 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dfile.cluster.useLHPEPS=true"/>
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="./server.sh"/>
        </exec>

        <echo>WAITING FOR SERVER STARTUP...</echo>
        <sleep seconds="5"/>

        <echo>EXECUTING TESTS USING REMOTE DATABASE: remote:localhost/demo</echo>
        <testng outputDir="target/test-output" haltOnFailure="true">
			<jvmarg value="-Dorientdb.config.file=${basedir}/src/test/resources/orientdb-server-config.xml"/>
            <classpath>
                <pathelement location="${project.build}"/>
                <fileset dir="${global.lib}">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
            <xmlfileset dir="${project.build}/com/orientechnologies/orient/test/database/auto"
                        includes="remote-test-db-from-scratch.xml"/>
        </testng>

        <echo>SHUTDOWNING THE SERVER...</echo>

        <exec dir="../${orient.path}/bin" executable="cmd" spawn="true" osfamily="windows">
            <arg value="/c shutdown.bat"/>
        </exec>

        <exec dir="../${orient.path}/bin" executable="sh" spawn="true" osfamily="unix">
            <arg value="./shutdown.sh"/>
        </exec>
        <sleep seconds="10"/>
    </target>


    <target name="stress-test">
        <echo>MASSIVE INSERT 1,000,000 FLAT RECORDS</echo>
        <java classname="com.orientechnologies.orient.test.database.speed.LocalCreateFlatSpeedTest" fork="yes">
            <classpath>
                <pathelement location="${project.build}"/><commit_msg>Fixed problem with shutdown of server after tests complete<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 1999-2010 <NAME> - LICENSE: Apache 2.0 -->
<project basedir="." default="compile" name="orientdb-tests">
    <property name="project.jar-classpath" value="orientdb-client-${version}.jar orientdb-client-${version}.jar"/>
    <property name="project.src" value="src/test/java"/>
    <property name="project.build" value="target/test-classes"/>

    <import file="../_base/base-build.xml"/>

    <taskdef resource="testngtasks" classpath="lib/testng.jar"/>

    <target name="test" depends="test-memory, test-local, test-local-lh, test-remote, test-remote-lh">
    </target>

    <target name="test-init">
        <copy todir="${project.build}">
            <fileset dir="src/test/java">
                <include name="**/*.xml"/>
            </fileset>
        </copy>

        <replace dir="${project.build}/com/orientechnologies/orient/test/database/auto">
            <include name="*-test-db-from-scratch.xml"/>

            <replacefilter token="@PATH@" value="${orient.path}/databases/demo"/>
            <replacefilter token="@URL@" value="local:${orient.path}/databases/demo"/>
        </replace>
    </target>

    <target name="test-memory" depends="test-init">
        <echo>EXECUTING TESTS USING MEMORY DATABASE: memory:demo</echo>
        <testng outputDir="target/test-output" haltOnFailure="true" verbose="2">
            <classpath>
                <pathelement location="${project.build}"/>
                <fileset dir="${global.lib}">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
            <xmlfileset dir="${project.build}/com/orientechnologies/orient/test/database/auto"
                        includes="memory-test-db-from-scratch.xml"/>
        </testng>
    </target>

    <target name="test-local" depends="test-init">
        <echo>EXECUTING TESTS USING LOCAL DATABASE: local:${orient.path}/databases/demo</echo>
        <testng outputDir="target/test-output" haltOnFailure="true" verbose="2">
            <classpath>
                <pathelement location="${project.build}"/>
                <fileset dir="${global.lib}">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
            <xmlfileset dir="${project.build}/com/orientechnologies/orient/test/database/auto"
                        includes="local-test-db-from-scratch.xml"/>
        </testng>
    </target>

    <target name="test-local-lh" depends="test-init">
        <echo>EXECUTING TESTS USING LOCAL DATABASE and LH data cluster: local:${orient.path}/databases/demo</echo>
        <testng outputDir="target/test-output" haltOnFailure="true" verbose="2">
            <jvmarg value="-Dfile.cluster.useLHPEPS=true"/>
            <classpath>
                <pathelement location="${project.build}"/>
                <fileset dir="${global.lib}">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
            <xmlfileset dir="${project.build}/com/orientechnologies/orient/test/database/auto"
                        includes="local-test-db-from-scratch.xml"/>
        </testng>
    </target>


    <target name="test-remote" depends="test-init">
        <echo>STARTING REMOTE ORIENTDB SERVER INSTANCE...</echo>
        <exec dir="../${orient.path}/bin" executable="cmd" spawn="true" osfamily="windows">
            <env key="JAVA_OPTS"
                 value="-Dcom.sun.management.jmxremote.port=4321 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" />
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="/c start server.bat"/>
        </exec>

        <exec dir="../${orient.path}/bin" executable="sh" spawn="true" osfamily="unix">
            <env key="JAVA_OPTS"
                 value="-Dcom.sun.management.jmxremote.port=4321 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" />
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="./server.sh"/>
        </exec>

        <echo>WAITING FOR SERVER STARTUP...</echo>
        <sleep seconds="5"/>

        <echo>EXECUTING TESTS USING REMOTE DATABASE: remote:localhost/demo</echo>
        <testng outputDir="target/test-output" haltOnFailure="true">
			<jvmarg value="-Dorientdb.config.file=${basedir}/src/test/resources/orientdb-server-config.xml"/>
            <classpath>
                <pathelement location="${project.build}"/>
                <fileset dir="${global.lib}">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
            <xmlfileset dir="${project.build}/com/orientechnologies/orient/test/database/auto"
                        includes="remote-test-db-from-scratch.xml"/>
        </testng>

        <echo>SHUTDOWNING THE SERVER...</echo>
        <exec dir="../${orient.path}/bin" executable="cmd" spawn="true" osfamily="windows">
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="/c shutdown.bat"/>
        </exec>

        <exec dir="../${orient.path}/bin" executable="sh" spawn="true" osfamily="unix">
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="./shutdown.sh"/>
        </exec>

        <sleep seconds="10"/>
    </target>

    <target name="test-remote-lh" depends="test-init" if="${fullTest}">
        <echo>STARTING REMOTE ORIENTDB SERVER INSTANCE WITH LH DATA CLUSTERS...</echo>
        <exec dir="../${orient.path}/bin" executable="cmd" spawn="true" osfamily="windows">
            <env key="JAVA_OPTS"
                 value="-Dcom.sun.management.jmxremote.port=4321 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dfile.cluster.useLHPEPS=true"/>
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="/c start server.bat"/>
        </exec>

        <exec dir="../${orient.path}/bin" executable="sh" spawn="true" osfamily="unix">
            <env key="JAVA_OPTS"
                 value="-Dcom.sun.management.jmxremote.port=4321 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dfile.cluster.useLHPEPS=true"/>
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="./server.sh"/>
        </exec>

        <echo>WAITING FOR SERVER STARTUP...</echo>
        <sleep seconds="5"/>

        <echo>EXECUTING TESTS USING REMOTE DATABASE: remote:localhost/demo</echo>
        <testng outputDir="target/test-output" haltOnFailure="true">
			<jvmarg value="-Dorientdb.config.file=${basedir}/src/test/resources/orientdb-server-config.xml"/>
            <classpath>
                <pathelement location="${project.build}"/>
                <fileset dir="${global.lib}">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
            <xmlfileset dir="${project.build}/com/orientechnologies/orient/test/database/auto"
                        includes="remote-test-db-from-scratch.xml"/>
        </testng>

        <echo>SHUTDOWNING THE SERVER...</echo>

        <exec dir="../${orient.path}/bin" executable="cmd" spawn="true" osfamily="windows">
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="/c shutdown.bat"/>
        </exec>

        <exec dir="../${orient.path}/bin" executable="sh" spawn="true" osfamily="unix">
			<env key="CONFIG_FILE" value="${basedir}/src/test/resources/orientdb-server-config.xml" />
            <arg value="./shutdown.sh"/>
        </exec>
        <sleep seconds="10"/>
    </target>


    <target name="stress-test">
        <echo>MASSIVE INSERT 1,000,000 FLAT RECORDS</echo>
        <java classname="com.orientechnologies.orient.test.database.speed.LocalCreateFlatSpeedTest" fork="yes">
            <classpath>
                <pathelement location="${project.build}"/>
{'fraction_non_alphanumeric': 0.17290851499906837, 'fraction_numerical': 0.005589714924538848, 'mean_word_length': 2.4531417542354705, 'pattern_counts': {'":': 0, '<': 297, '<?xml version=': 2, '>': 297, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 44}, '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': '3048168', 'n_tokens_mistral': 5016, 'n_tokens_neox': 4758, 'n_words': 731}