// Path: src/main/java/de/thetaphi/forbiddenapis/Checker.java
// public static enum Option {
//   FAIL_ON_MISSING_CLASSES,
//   FAIL_ON_VIOLATION,
//   FAIL_ON_UNRESOLVABLE_SIGNATURES,
//   IGNORE_SIGNATURES_OF_MISSING_CLASSES,
//   DISABLE_CLASSLOADING_CACHE
// }


import static de.thetaphi.forbiddenapis.Checker.Option.*;
import static org.junit.Assert.*;
import static org.junit.Assume.assumeTrue;
import static org.junit.Assume.assumeNoException;
import java.util.Collections;
import java.util.EnumSet;
import org.junit.Before;
import org.junit.Test;
import org.objectweb.asm.commons.Method;
    assertTrue(forbiddenSignatures.signatures.containsKey(Signatures.getKey("java/lang/String", new Method("copyValueOf", "([CII)Ljava/lang/String;"))));
    
    assertEquals(Collections.emptySet(), forbiddenSignatures.classPatterns);
    assertFalse(checker.hasNoSignatures());
    assertFalse(checker.noSignaturesFilesParsed());
  }
  
  @Test
  public void testWildcardMethodSignatureNoArgs() throws Exception {
    checker.parseSignaturesString("java.lang.Object#toString(**) @ Foobar");
    assertEquals(Collections.singletonMap(Signatures.getKey("java/lang/Object", new Method("toString", "()Ljava/lang/String;")), "java.lang.Object#toString(**) [Foobar]"),
        forbiddenSignatures.signatures);
    assertEquals(Collections.emptySet(), forbiddenSignatures.classPatterns);
    assertFalse(checker.hasNoSignatures());
    assertFalse(checker.noSignaturesFilesParsed());
  }
  
  @Test
  public void testWildcardMethodSignatureNotExist() throws Exception {
    try {
      checker.parseSignaturesString("java.lang.Object#foobarNotExist(**) @ Foobar");
      fail("Should fail to parse because method does not exist");
    } catch (ParseException pe) {
      assertEquals("Method not found while parsing signature: java.lang.Object#foobarNotExist(**)", pe.getMessage());
    }
  }
  
  @Test
  public void testEmptyCtor() throws Exception {
    Checker chk = new Checker(StdIoLogger.INSTANCE, ClassLoader.getSystemClassLoader());
// Path: src/main/java/de/thetaphi/forbiddenapis/Checker.java
// public static enum Option {
//   FAIL_ON_MISSING_CLASSES,
//   FAIL_ON_VIOLATION,
//   FAIL_ON_UNRESOLVABLE_SIGNATURES,
//   IGNORE_SIGNATURES_OF_MISSING_CLASSES,
//   DISABLE_CLASSLOADING_CACHE
// }


// Path: src/test/java/de/thetaphi/forbiddenapis/CheckerSetupTest.java
import static de.thetaphi.forbiddenapis.Checker.Option.*;
import static org.junit.Assert.*;
import static org.junit.Assume.assumeTrue;
import static org.junit.Assume.assumeNoException;
import java.util.Collections;
import java.util.EnumSet;
import org.junit.Before;
import org.junit.Test;
import org.objectweb.asm.commons.Method;

    assertTrue(forbiddenSignatures.signatures.containsKey(Signatures.getKey("java/lang/String", new Method("copyValueOf", "([CII)Ljava/lang/String;"))));
    
    assertEquals(Collections.emptySet(), forbiddenSignatures.classPatterns);
    assertFalse(checker.hasNoSignatures());
    assertFalse(checker.noSignaturesFilesParsed());
  }
  
  @Test
  public void testWildcardMethodSignatureNoArgs() throws Exception {
    checker.parseSignaturesString("java.lang.Object#toString(**) @ Foobar");
    assertEquals(Collections.singletonMap(Signatures.getKey("java/lang/Object", new Method("toString", "()Ljava/lang/String;")), "java.lang.Object#toString(**) [Foobar]"),
        forbiddenSignatures.signatures);
    assertEquals(Collections.emptySet(), forbiddenSignatures.classPatterns);
    assertFalse(checker.hasNoSignatures());
    assertFalse(checker.noSignaturesFilesParsed());
  }
  
  @Test
  public void testWildcardMethodSignatureNotExist() throws Exception {
    try {
      checker.parseSignaturesString("java.lang.Object#foobarNotExist(**) @ Foobar");
      fail("Should fail to parse because method does not exist");
    } catch (ParseException pe) {
      assertEquals("Method not found while parsing signature: java.lang.Object#foobarNotExist(**)", pe.getMessage());
    }
  }
  
  @Test
  public void testEmptyCtor() throws Exception {
    Checker chk = new Checker(StdIoLogger.INSTANCE, ClassLoader.getSystemClassLoader());
    assertEquals(EnumSet.noneOf(Checker.Option.class), chk.options);