BAEL-831 ClassNotFoundExceptions vs NoClassDefFoundError (#1899)
* Dependency Injection examples Dependency Injection examples for evaluation article * Junit test cases added for dependency injection Junit test cases added for dependency injection * ClassNotFoundException vs NoClassDefFoundError Example to reproduce ClassNotFoundException & NoClassDefFoundError * JUnit test cases for ClassNotFoundException & NoClassDefFoundError test cases to reproduce ClassNotFoundException & NoClassDefFoundError * Deleting exampls for evaluation article * BAEL-831 Examples for ClassNotFoundException & NoClassDefFoundError * deleting config file for evaluation article deleting config file for evaluation article
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package com.baeldung.classnotfoundexception;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ClassNotFoundExceptionTest {
|
||||
|
||||
@Test(expected = ClassNotFoundException.class)
|
||||
public void givenNoDriversInClassPath_whenLoadDrivers_thenClassNotFoundException() throws ClassNotFoundException {
|
||||
ClassNotFoundExceptionExample test = new ClassNotFoundExceptionExample();
|
||||
test.loadDrivers();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.baeldung.noclassdeffounderror;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class NoClassDefFoundErrorTest {
|
||||
|
||||
@Test(expected = NoClassDefFoundError.class)
|
||||
public void givenInitErrorInClass_whenloadClass_thenNoClassDefFoundError() {
|
||||
NoClassDefFoundErrorExample sample = new NoClassDefFoundErrorExample();
|
||||
sample.getClassWithInitErrors();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user