test/tools/javac/processing/filer/TestGetResource.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -24,10 +24,12 @@
 /*
  * @test
  * @bug 6380018 6449798
  * @summary Test Filer.getResource
  * @author  Joseph D. Darcy
+ * @library ../../lib
+ * @build  JavacTestingAbstractProcessor
  * @build TestGetResource
  * @compile -processor TestGetResource -proc:only -Aphase=write TestGetResource.java
  * @compile -processor TestGetResource -proc:only -Aphase=read  TestGetResource.java
  */
 

@@ -47,17 +49,12 @@
 /**
  * Test basic functionality of the Filer.getResource method.  On the
  * first run of the annotation processor, write out a resource file
  * and on the second run read it in.
  */
-@SupportedAnnotationTypes("*")
 @SupportedOptions("phase")
-public class TestGetResource extends AbstractProcessor {
-    private Messager messager;
-    private Filer filer;
-    private Map<String,String> options;
-
+public class TestGetResource extends JavacTestingAbstractProcessor {
     private static String CONTENTS = "Hello World.";
     private static String PKG = "";
     private static String RESOURCE_NAME = "Resource1";
 
     public boolean process(Set<? extends TypeElement> annotations,

@@ -90,17 +87,6 @@
         } catch(IOException ioe) {
             throw new RuntimeException(ioe);
         }
         return false;
     }
-
-    public SourceVersion getSupportedSourceVersion() {
-        return SourceVersion.latest();
-    }
-
-    public void init(ProcessingEnvironment processingEnv) {
-        super.init(processingEnv);
-        messager = processingEnv.getMessager();
-        filer    = processingEnv.getFiler();
-        options  = processingEnv.getOptions();
-    }
 }