/*
* 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.
*/
/**
* Annotation processor for the @Test annotation.
* Invokes each method so annotated, and verifies the result.
* Throws an Error on failure.
*
* @author Scott Seligman
*/
// The tester that's running.
}
/**
* Reflectively invoke the @Test-annotated methods of the live
* tester. Those methods perform the actual exercising of the
* mirror API. Then back here to verify the results by
* reading the live annotations. Convoluted, you say?
*/
public void process() {
boolean failed = false; // true if a test returns wrong result
try {
} catch (Exception e) {
throw new Error("Test invocation failed", e);
}
boolean ok = true; // result of this test
} else if (m.getReturnType() != void.class) {
}
if (!ok) {
failed = true;
}
} else {
}
}
}
}
if (failed) {
throw new Error("Test(s) returned unexpected result");
}
}
/**
* Verify that a single-valued (non-Collection) result matches
* its expected value.
*/
}
/**
* Verify that a multi-valued result (a Collection) matches
* its expected values.
*/
return false;
}
// Convert result to an array of strings.
int i = 0;
}
if (!ordered) {
}
}
}