// Copyright 2015 Google Inc. All rights reserved.
//
// 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.

package com.google.devtools.build.lib.bazel.rules.java;

import com.google.devtools.build.lib.vfs.PathFragment;

import junit.framework.TestCase;

/**
 * Unit tests for {@link BazelJavaSemantics}.
 */
public class BazelJavaSemanticsTest extends TestCase {
  public void testFindingResources() {
    BazelJavaSemantics semantics = BazelJavaSemantics.INSTANCE;
    assertEquals(PathFragment.EMPTY_FRAGMENT,
        semantics.getJavaResourcePath(new PathFragment("x/y/src/main/resources")));
    assertEquals(new PathFragment("foo"),
        semantics.getJavaResourcePath(new PathFragment("x/y/src/main/resources/foo")));
    assertEquals(new PathFragment("foo"),
        semantics.getJavaResourcePath(new PathFragment("java/x/y/src/main/resources/foo")));
    assertEquals(new PathFragment("foo/java/bar"),
        semantics.getJavaResourcePath(new PathFragment("java/foo/java/bar")));
    assertEquals(new PathFragment("foo/java/bar"),
        semantics.getJavaResourcePath(new PathFragment("javatests/foo/java/bar")));
  }
}

@@ -659,16 +659,62 @@
 .java;%0A%0A
+import static org.junit.Assert.assertEquals;%0A%0A
 import c
@@ -772,32 +772,88 @@
 ort 
+org.
 junit.
-framework.TestCase
+Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.JUnit4
 ;%0A%0A/
@@ -905,16 +905,39 @@
 s%7D.%0A */%0A
+@RunWith(JUnit4.class)%0A
 public c
@@ -968,26 +968,17 @@
 est 
-extends TestCase %7B
+%7B%0A  @Test
 %0A  p

Rewrite test to JUnit 4.