test/tools/javac/processing/filer/TestGetResource.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2006, 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.
--- 1,7 ----
/*
! * 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,34 ****
/*
* @test
* @bug 6380018 6449798
* @summary Test Filer.getResource
* @author Joseph D. Darcy
! * @build TestGetResource
* @compile -processor TestGetResource -proc:only -Aphase=write TestGetResource.java
* @compile -processor TestGetResource -proc:only -Aphase=read TestGetResource.java
*/
import java.util.Set;
--- 24,35 ----
/*
* @test
* @bug 6380018 6449798
* @summary Test Filer.getResource
* @author Joseph D. Darcy
! * @library ../../lib
! * @build JavacTestingAbstractProcessor TestGetResource
* @compile -processor TestGetResource -proc:only -Aphase=write TestGetResource.java
* @compile -processor TestGetResource -proc:only -Aphase=read TestGetResource.java
*/
import java.util.Set;
*** 47,63 ****
/**
* 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;
!
private static String CONTENTS = "Hello World.";
private static String PKG = "";
private static String RESOURCE_NAME = "Resource1";
public boolean process(Set<? extends TypeElement> annotations,
--- 48,59 ----
/**
* 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.
*/
@SupportedOptions("phase")
! 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,106 ****
} 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();
- }
}
--- 86,91 ----