jaroslav@528: package ${package}; jaroslav@514: jaroslav@534: import org.apidesign.bck2brwsr.vmtest.Compare; jaroslav@534: import org.apidesign.bck2brwsr.vmtest.VMTest; jaroslav@534: import org.testng.annotations.Factory; jaroslav@514: jaroslav@534: /** Bck2brwsr cares about compatibility with real Java. Whatever API is jaroslav@534: * supported by bck2brwsr, it needs to behave the same way as when running jaroslav@534: * in HotSpot VM. jaroslav@534: *
jaroslav@534: * There can be bugs, however. To help us fix them, we kindly ask you to
jaroslav@534: * write an "inconsistency" test. A test that compares behavior of the API
jaroslav@534: * between real VM and bck2brwsr VM. This class is skeleton of such test.
jaroslav@514: */
jaroslav@534: public class InconsistencyTest {
jaroslav@534: /** A method to demonstrate inconsistency between bck2brwsr and HotSpot.
jaroslav@534: * Make calls to an API that behaves strangely, return some result at
jaroslav@534: * the end. No need to use any assert
.
jaroslav@534: *
jaroslav@534: * @return value to compare between HotSpot and bck2brwsr
jaroslav@534: */
jaroslav@534: @Compare
jaroslav@534: public int checkStringHashCode() throws Exception {
jaroslav@534: return "Is string hashCode the same?".hashCode();
jaroslav@514: }
jaroslav@514:
jaroslav@534: /** Factory method that creates a three tests for each method annotated with
jaroslav@534: * {@link org.apidesign.bck2brwsr.vmtest.Compare}. One executes the code in
jaroslav@534: * HotSpot, one in Rhino and the last one compares the results.
jaroslav@534: *
jaroslav@534: * @see org.apidesign.bck2brwsr.vmtest.VMTest
jaroslav@534: */
jaroslav@534: @Factory
jaroslav@534: public static Object[] create() {
jaroslav@534: return VMTest.create(InconsistencyTest.class);
jaroslav@514: }
jaroslav@534:
jaroslav@514: }