Package samples.staticinitializer

Examples of samples.staticinitializer.EvilStaticInitializerExample


public class EvilStaticInitializerExampleTest {

  @Test
  @SuppressStaticInitializationFor("samples.staticinitializer.EvilStaticInitializerExample")
  public void assertNativeCodeInvocationWorks() throws Exception {
    EvilStaticInitializerExample tested = new EvilStaticInitializerExample();
    assertThat(tested.doSomeNativeStuffUsingTheLoadedSystemLibrary(), instanceOf(String.class));
  }
View Full Code Here


  }

  @Test
  public void assertCorrectErrorMessageIfLibraryNotFound() throws Exception {
    try {
      new EvilStaticInitializerExample();
      fail("Should throw unsatisfied link error!");
    } catch (UnsatisfiedLinkError error) {
      assertEquals(error.getMessage(), EvilStaticInitializerExample.FAILED_TO_LOAD_LIBRARY_MESSAGE);
    }
  }
View Full Code Here

TOP

Related Classes of samples.staticinitializer.EvilStaticInitializerExample

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.