/* Copyright (c) 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @author Sergey Vorobyev
 */
public class CustomTests {

  static class staticFinalProvider {
    private static final int x = 42;
    static int getX() {
      return x;
    }
  }

  @RaceTest(expectRace = false,
      description = "Static final variable init and access")
  public void staticFinal() {
    new ThreadRunner(4) {
      public void thread1() {
        shortSleep();
        int z = staticFinalProvider.getX();
      }
      public void thread2() {
        thread1();
      }
      public void thread3() {
        thread1();
      }
      public void thread4() {
        thread1();
      }
    };
  }

  @RaceTest(expectRace = false,
      description = "Stop thread by throwing Exception")
  public void exceptionExit() {
    new ThreadRunner(2) {
      public synchronized void thread1() {
        sharedVar++;
        throw new RuntimeException("Exit from thread1 with this Exception");
      }
      public synchronized void thread2() {
        sharedVar++;
      }
    };
  }

}

@@ -653,16 +653,227 @@
 ests %7B%0A%0A
+  static class HugeMethodProvider %7B%0A    static int hugeMethod() %7B%0A      int x = 1;%0A      int y = 1;%0A      for (int i=0; i%3C1000000; i++) %7B%0A        x = x + y;%0A        y = x - y;%0A      %7D%0A      return x;%0A    %7D%0A  %7D%0A%0A
   static
@@ -938,10 +938,39 @@
 x = 
-42
+HugeMethodProvider.hugeMethod()
 ;%0A  
@@ -1163,24 +1163,24 @@
 Runner(4) %7B%0A
+
       public
@@ -1201,30 +1201,8 @@
 ) %7B%0A
-        shortSleep();%0A
     

Make staticFinal test more hard to pass