<commit_before>package com.hendraanggrian.openpss.db

import com.hendraanggrian.openpss.ConditionalIgnoreRule
import com.hendraanggrian.openpss.db.schemas.Employee
import com.hendraanggrian.openpss.io.properties.LoginFile
import kotlinx.coroutines.runBlocking
import org.apache.log4j.BasicConfigurator
import org.junit.Rule
import org.junit.Test

class DatabaseTest {

    @Rule var rule = ConditionalIgnoreRule()

    @Test
    @ConditionalIgnoreRule.ConditionalIgnore(NotRunningInTravis::class)
    fun login() {
        if (LoginFile.isDbValid()) {
            BasicConfigurator.configure()
            runBlocking {
                try {
                    login(
                        LoginFile.DB_HOST,
                        LoginFile.DB_PORT,
                        LoginFile.DB_USER,
                        LoginFile.DB_PASSWORD,
                        Employee.BACKDOOR.name,
                        Employee.BACKDOOR.password
                    )
                    println(dbDateTime)
                } catch (e: Exception) {
                    error(e.message.toString())
                }
            }
        }
    }

    class NotRunningInTravis : ConditionalIgnoreRule.IgnoreCondition {
        override fun isSatisfied(): Boolean = System.getProperty("user.name") != "travis"
    }
}<commit_msg>Testing ConditionalIgnoreRula<commit_after>package com.hendraanggrian.openpss.db

import com.hendraanggrian.openpss.ConditionalIgnoreRule
import com.hendraanggrian.openpss.db.schemas.Employee
import com.hendraanggrian.openpss.io.properties.LoginFile
import kotlinx.coroutines.runBlocking
import org.apache.log4j.BasicConfigurator
import org.junit.Rule
import org.junit.Test

class DatabaseTest {

    @Rule var rule = ConditionalIgnoreRule()

    @Test
    @ConditionalIgnoreRule.ConditionalIgnore(RunningInTravis::class)
    fun login() {
        if (LoginFile.isDbValid()) {
            BasicConfigurator.configure()
            runBlocking {
                try {
                    login(
                        LoginFile.DB_HOST,
                        LoginFile.DB_PORT,
                        LoginFile.DB_USER,
                        LoginFile.DB_PASSWORD,
                        Employee.BACKDOOR.name,
                        Employee.BACKDOOR.password
                    )
                    println(dbDateTime)
                } catch (e: Exception) {
                    error(e.message.toString())
                }
            }
        }
    }

    class RunningInTravis : ConditionalIgnoreRule.IgnoreCondition {
        override fun isSatisfied(): Boolean = System.getProperty("user.name") == "travis"
    }
}
{'fraction_non_alphanumeric': 0.07900677200902935, 'fraction_numerical': 0.0007524454477050414, 'mean_word_length': 1.7872117400419287, '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': '3019079', 'n_tokens_mistral': 744, 'n_tokens_neox': 706, 'n_words': 105}