mardi 12 mars 2019

can not see the real exception in gradle tests

I have test class A that extends some base class from external library

class A extends com.thirdparty.BaseClass {

    @Test public void test () {
        System.out.println("executing test")
    }
}

meanwhile BaseClass always throws exception in its constructor

class BaseClass {
    BaseClass() {
        throw new RuntimeException("Exception")
    }
} 

in that case when I run test with gradle from command line, it gives me java.lang.NoClassDefFoundError error, and I have no clue that the real exception is RuntimeException.

What I want, is to see the real RuntimeException anywhere.

I've tried

tasks.withType(Test) {
    testLogging {
        showStandartStreams = true
    }
}   

but it gave no result

Aucun commentaire:

Enregistrer un commentaire