// Path: main/com/google/testing/threadtester/AnnotatedTestRunner.java
// public class AnnotatedTestRunner extends BaseThreadedTestRunner {
//   @Override
//   protected String getWrapperName() {
//     return AnnotatedTestWrapper.class.getName();
//   }
// }
// 
// Path: main/com/google/testing/threadtester/MethodOption.java
// public enum MethodOption {
//   /**
//    * Only the method called directly by the &#064;ThreadedMain method is tested.
//    * This is the normal mod of operation.
//    */
//   MAIN_METHOD (0),
// 
//   /**
//    * All methods in the instrumented classes are tested.
//    */
//   ALL_METHODS (1),
// 
//   /**
//    * An explicit list of methods is tested.
//    */
//   LISTED_METHODS (2);
// 
//   public final int value;
// 
//   MethodOption(int v) {
//     this.value = v;
//   }
// 
//   /**
//    * Creates a MethodOption from its integer equivalent.
//    */
//   static MethodOption fromInt(int v){
//     for (MethodOption m: MethodOption.values()) {
//       if (m.value == v)
//         return m;
//     }
//     throw new IllegalArgumentException("Invalid value " + v);
//   }
// }


import com.google.testing.threadtester.AnnotatedTestRunner;
import com.google.testing.threadtester.MethodOption;
import com.google.testing.threadtester.ThreadedAfter;
import com.google.testing.threadtester.ThreadedBefore;
import com.google.testing.threadtester.ThreadedMain;
import com.google.testing.threadtester.ThreadedSecondary;
import java.util.HashSet;
import junit.framework.TestCase;
/*
 * Copyright 2009 Weaver authors
 *
 * This code is part of the Weaver tutorial and may be freely used.
 */






/**
 * Unit test for UniqueList. Demonstrates use of
 * {@link com.google.testing.threadtester.AnnotatedTestRunner}.
 *
 * NOTE: This test will fail. It was written to demonstrate a fault in the class
 * under test.
 *
 * @author alasdair.mackintosh@gmail.com (Alasdair Mackintosh)
 */
public class UniqueListTest extends TestCase {

  private static final String HELLO = "Hello";

  private volatile UniqueList<String> uniqueList;

  public void testPutIfAbsent() {
    System.out.printf("In testPutIfAbsent\n");
    // Create an AnnotatedTestRunner that will run the threaded tests defined in this
    // class. We want to test the behaviour of the private method "putIfAbsentInternal" so
    // we need to specify it by name using runner.setMethodOption()
// Path: main/com/google/testing/threadtester/AnnotatedTestRunner.java
// public class AnnotatedTestRunner extends BaseThreadedTestRunner {
//   @Override
//   protected String getWrapperName() {
//     return AnnotatedTestWrapper.class.getName();
//   }
// }
// 
// Path: main/com/google/testing/threadtester/MethodOption.java
// public enum MethodOption {
//   /**
//    * Only the method called directly by the &#064;ThreadedMain method is tested.
//    * This is the normal mod of operation.
//    */
//   MAIN_METHOD (0),
// 
//   /**
//    * All methods in the instrumented classes are tested.
//    */
//   ALL_METHODS (1),
// 
//   /**
//    * An explicit list of methods is tested.
//    */
//   LISTED_METHODS (2);
// 
//   public final int value;
// 
//   MethodOption(int v) {
//     this.value = v;
//   }
// 
//   /**
//    * Creates a MethodOption from its integer equivalent.
//    */
//   static MethodOption fromInt(int v){
//     for (MethodOption m: MethodOption.values()) {
//       if (m.value == v)
//         return m;
//     }
//     throw new IllegalArgumentException("Invalid value " + v);
//   }
// }


// Path: examples/UniqueListTest.java
import com.google.testing.threadtester.AnnotatedTestRunner;
import com.google.testing.threadtester.MethodOption;
import com.google.testing.threadtester.ThreadedAfter;
import com.google.testing.threadtester.ThreadedBefore;
import com.google.testing.threadtester.ThreadedMain;
import com.google.testing.threadtester.ThreadedSecondary;
import java.util.HashSet;
import junit.framework.TestCase;

/*
 * Copyright 2009 Weaver authors
 *
 * This code is part of the Weaver tutorial and may be freely used.
 */






/**
 * Unit test for UniqueList. Demonstrates use of
 * {@link com.google.testing.threadtester.AnnotatedTestRunner}.
 *
 * NOTE: This test will fail. It was written to demonstrate a fault in the class
 * under test.
 *
 * @author alasdair.mackintosh@gmail.com (Alasdair Mackintosh)
 */
public class UniqueListTest extends TestCase {

  private static final String HELLO = "Hello";

  private volatile UniqueList<String> uniqueList;

  public void testPutIfAbsent() {
    System.out.printf("In testPutIfAbsent\n");
    // Create an AnnotatedTestRunner that will run the threaded tests defined in this
    // class. We want to test the behaviour of the private method "putIfAbsentInternal" so
    // we need to specify it by name using runner.setMethodOption()
    AnnotatedTestRunner runner = new AnnotatedTestRunner();