<commit_before>#!/bin/sh

export CATALINA_HOME=/usr/share/tomcat6

ant clean-all

ant automated-test-run

exit $?<commit_msg>use temp tomcat directory for automated testing<commit_after>#!/bin/sh

# wec
export CATALINA_HOME=${HOME}/automated
# macos tomcat
#ORIG_TOMCAT=/usr/local/tomcat
# linux/jenkins host tomcat
ORIG_TOMCAT=/usr/share/tomcat6

mkdir_copy_files() {
    if [ -z "$1" ]; then
	return 0
    fi

    echo "Copying $1 files to $2..."

    mkdir -p $2
    cp -R $1/* $2
    return $?
}

if [ ! -d ${ORIG_TOMCAT} ]; then
    echo "Tomcat must be installed on this system"
    exit 1
fi

if [ -d ${CATALINA_HOME} ]; then
    echo "Existing test Tomcat exists!!!"
    exit 1
fi

# now let's copy over the required files...
mkdir_copy_files ${ORIG_TOMCAT}/conf ${CATALINA_HOME}/conf
mkdir_copy_files ${ORIG_TOMCAT}/bin ${CATALINA_HOME}/bin
mkdir_copy_files ${ORIG_TOMCAT}/lib ${CATALINA_HOME}/lib
mkdir_copy_files ${ORIG_TOMCAT}/logs ${CATALINA_HOME}/logs
mkdir_copy_files ${ORIG_TOMCAT}/temp ${CATALINA_HOME}/temp
mkdir_copy_files ${ORIG_TOMCAT}/webapps ${CATALINA_HOME}/webapps
mkdir_copy_files ${ORIG_TOMCAT}/work ${CATALINA_HOME}/work

ant clean-all

ant automated-test-run

# clean up our temp tomcat!
rm -rf ${CATALINA_HOME}

exit $?
{'fraction_non_alphanumeric': 0.1297037630104083, 'fraction_numerical': 0.008807045636509208, 'mean_word_length': 4.319148936170213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4655716', 'n_tokens_mistral': 522, 'n_tokens_neox': 478, 'n_words': 115}