/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6341866
* @summary Source files loaded from source path are not subject to annotation processing
* @build Anno T6341866
* @run main T6341866
*/
/**
* For each of a number of implicit compilation scenarios,
* and for each of a set of annotation processing scenarios,
* verify that a class file is generated, or not, for an
* implicitly compiled source file and that the correct
* warning message is given for implicitly compiled files
* when annotation processing.
*/
public class T6341866 {
enum ImplicitType {
}
};
enum AnnoType {
};
boolean ok = true;
// iterate over all combinations
}
}
if (!ok)
throw new AssertionError("test failed");
}
/**
* Verify that a class file is generated, or not, for an implicitly compiled source file,
* and that the correct warning message is given for implicitly compiled files when annotation processing.
*/
// ensure clean start
opts.addAll(Arrays.asList("-d", ".", "-sourcepath", testSrc, "-classpath", testClasses, "-source", "1.6", "-Xlint:-options"));
switch (annoType) {
case SERVICE:
break;
case SPECIFY:
break;
}
// Note: class A references class B, so compile A if we want implicit compilation
//System.err.println("compile: " + opts + " " + files);
if (!ok) {
error("compilation failed");
return false;
}
// check implicit compilation results if necessary
error("B implicitly compiled unexpectedly");
else
error("B not impliictly compiled");
return false;
}
}
// check message key results
switch (annoType) {
case SERVICE:
expectKey = "compiler.warn.proc.use.proc.or.implicit";
break;
case SPECIFY:
expectKey = "compiler.warn.proc.use.implicit";
break;
}
}
error("no diagnostics expected");
return false;
}
} else {
error("unexpected diagnostics generated");
return false;
}
}
return true;
}
}
}
}
}
}
}