view tests-custom/src/main/scratch/completable/future-completable.xml @ 66:d7f7a93800e4

Rewire the grading levels: introduce ACCEPTABLE_SPEC, remove REQUIRED, renames.
author shade
date Thu, 28 Nov 2013 19:10:32 +0400
parents dd797d922f1c
children 7a9f5f818d94
line wrap: on
line source
<!--

    Copyright (c) 2005, 2013, 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.  Oracle designates this
    particular file as subject to the "Classpath" exception as provided
    by Oracle in the LICENSE file that accompanied this code.

    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.

-->
<testsuite>

    <template name="consistentGet">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[0, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>T2 had claimed the Future. T1 reads the consistent value</description>
        </case>
        <case>
            <match>[1, 42, 0, 42]</match>
            <expect>ACCEPTABLE</expect>
            <description>T1 had claimed the Future. T2 reads the consistent value</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>
                This case is not expected.
            </description>
        </unmatched>
    </template>

    <template name="consistentGet_Except">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[0, -2, 1, -2]</match>
            <expect>ACCEPTABLE</expect>
            <description>T2 had claimed the Future. T1 reads the consistent exception</description>
        </case>
        <case>
            <match>[1, 42, 0, 42]</match>
            <expect>ACCEPTABLE</expect>
            <description>T1 had claimed the Future. T2 reads the consistent value</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>
                This case is not expected.
            </description>
        </unmatched>
    </template>

    <template name="consistentExcept_Except">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[0, -2, 1, -2]</match>
            <expect>ACCEPTABLE</expect>
            <description>T2 had claimed the Future. T1 reads the consistent exception</description>
        </case>
        <case>
            <match>[1, -1, 0, -1]</match>
            <expect>ACCEPTABLE</expect>
            <description>T1 had claimed the Future. T2 reads the consistent exception</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>
                This case is not expected.
            </description>
        </unmatched>
    </template>

    <test template="consistentGet" name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$Complete_Complete_Get" />
    <test template="consistentGet" name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$Complete_Complete_GetNow" />

    <test template="consistentGet_Except" name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$Complete_CompleteExcept_Get" />
    <test template="consistentGet_Except" name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$Complete_CompleteExcept_GetNow" />

    <test template="consistentExcept_Except" name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$CompleteExcept_CompleteExcept_Get" />
    <test template="consistentExcept_Except" name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$CompleteExcept_CompleteExcept_GetNow" />

    <test name="org.openjdk.jcstress.tests.future.completable.GetRaceTests$Complete_Get">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[42]</match>
            <expect>ACCEPTABLE</expect>
            <description>Observing the consistent value.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetRaceTests$Complete_GetNow">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[-1]</match>
            <expect>ACCEPTABLE</expect>
            <description>Observing the fallback value.</description>
        </case>
        <case>
            <match>[42]</match>
            <expect>ACCEPTABLE</expect>
            <description>Observing the consistent value.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetRaceTests$Force_Get">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[42]</match>
            <expect>ACCEPTABLE</expect>
            <description>Observing the consistent value.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetRaceTests$Force_GetNow">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[-1]</match>
            <expect>ACCEPTABLE</expect>
            <description>Observing the fallback value.</description>
        </case>
        <case>
            <match>[42]</match>
            <expect>ACCEPTABLE</expect>
            <description>Observing the consistent value.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetRaceTests$CompleteExcept_Get">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[-1]</match>
            <expect>ACCEPTABLE</expect>
            <description>Observing the correct exception.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetRaceTests$CompleteExcept_GetNow">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[-10]</match>
            <expect>ACCEPTABLE</expect>
            <description>Observing the fallback value.</description>
        </case>
        <case>
            <match>[-1]</match>
            <expect>ACCEPTABLE</expect>
            <description>Observing the correct exception.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$CompleteExcept_Force_Get">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[0, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>Completing with exception had not yet happened; T2 is observing the forced value.</description>
        </case>
        <case>
            <match>[1, -1, 1, 43]</match>
            <expect>ACCEPTABLE_INTERESTING</expect>
            <description>T1 observes it's exception; T2 observes the forced value.</description>
        </case>
        <case>
            <match>[1, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>Both T1 and T2 are observing the exception from T1.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$CompleteExcept_Force_GetNow">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[0, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>Completing with exception had not yet happened; T2 is observing the forced value.</description>
        </case>
        <case>
            <match>[1, -1, 1, 43]</match>
            <expect>ACCEPTABLE_INTERESTING</expect>
            <description>T1 observes it's exception; T2 observes the forced value.</description>
        </case>
        <case>
            <match>[1, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>Both T1 and T2 are observing the exception from T1.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$Complete_Force_Get">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[0, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>T1 had not yet happened; T2 is observing the forced value.</description>
        </case>
        <case>
            <match>[1, 42, 1, 43]</match>
            <expect>ACCEPTABLE_INTERESTING</expect>
            <description>T1 observes it's completed value; T2 observes the forced value.</description>
        </case>
        <case>
            <match>[1, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>Both T1 and T2 are observing the exception from T1.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$Complete_Force_GetNow">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[0, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>T1 had not yet happened; T2 is observing the forced value.</description>
        </case>
        <case>
            <match>[1, 42, 1, 43]</match>
            <expect>ACCEPTABLE_INTERESTING</expect>
            <description>T1 observes it's completed value; T2 observes the forced value.</description>
        </case>
        <case>
            <match>[1, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>Both T1 and T2 are observing the exception from T1.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$Force_Force_Get">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[1, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>Both T1 and T2 are observing the T2 state.</description>
        </case>
        <case>
            <match>[1, 42, 1, 43]</match>
            <expect>ACCEPTABLE_INTERESTING</expect>
            <description>T1 observes it's completed value; T2 observes the forced value.</description>
        </case>
        <case>
            <match>[1, 42, 1, 42]</match>
            <expect>ACCEPTABLE</expect>
            <description>Both T1 and T2 are observing the T1 state.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

    <test name="org.openjdk.jcstress.tests.future.completable.GetConflictTests$Force_Force_GetNow">
        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
        <description>Tests if CompletableFuture is racy.</description>
        <case>
            <match>[1, 43, 1, 43]</match>
            <expect>ACCEPTABLE</expect>
            <description>Both T1 and T2 are observing the T2 state.</description>
        </case>
        <case>
            <match>[1, 42, 1, 43]</match>
            <expect>ACCEPTABLE_INTERESTING</expect>
            <description>T1 observes it's completed value; T2 observes the forced value.</description>
        </case>
        <case>
            <match>[1, 42, 1, 42]</match>
            <expect>ACCEPTABLE</expect>
            <description>Both T1 and T2 are observing the T1 state.</description>
        </case>
        <unmatched>
            <expect>FORBIDDEN</expect>
            <description>This case is not expected.</description>
        </unmatched>
    </test>

</testsuite>