Search in sources :

Example 1 with LoadClass

use of org.hibernate.validator.internal.util.privilegedactions.LoadClass in project hibernate-validator by hibernate.

the class LoadClassTest method test_loading_dummy_class_throws_exception_without_fallback_to_tcl.

@Test
public void test_loading_dummy_class_throws_exception_without_fallback_to_tcl() {
    final LoadClass action = LoadClass.action("org.hibernate.validator.Dummy", null, false);
    runLoadClass(action);
}
Also used : LoadClass(org.hibernate.validator.internal.util.privilegedactions.LoadClass) Test(org.testng.annotations.Test)

Example 2 with LoadClass

use of org.hibernate.validator.internal.util.privilegedactions.LoadClass in project hibernate-validator by hibernate.

the class LoadClassTest method test_loading_dummy_class_throws_exception_with_fallback_to_tcl.

@Test
public void test_loading_dummy_class_throws_exception_with_fallback_to_tcl() {
    final LoadClass action = LoadClass.action("org.hibernate.validator.Dummy", null, true);
    final ClassLoader current = currentThread().getContextClassLoader();
    try {
        currentThread().setContextClassLoader(null);
        runLoadClass(action);
    } finally {
        currentThread().setContextClassLoader(current);
    }
}
Also used : LoadClass(org.hibernate.validator.internal.util.privilegedactions.LoadClass) Test(org.testng.annotations.Test)

Aggregations

LoadClass (org.hibernate.validator.internal.util.privilegedactions.LoadClass)2 Test (org.testng.annotations.Test)2