changeset 185:8761a67b7fc9

Migrate future.* tests to annotation API.
author shade
date Tue, 12 Aug 2014 14:59:45 +0400
parents 738093b93231
children 8d289a23c8c8
files tests-custom/src/main/java/org/openjdk/jcstress/tests/future/FutureTaskSetTest.java tests-custom/src/main/resources/org/openjdk/jcstress/desc/future.xml
diffstat 2 files changed, 8 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/future/FutureTaskSetTest.java	Tue Aug 12 14:18:24 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/future/FutureTaskSetTest.java	Tue Aug 12 14:59:45 2014 +0400
@@ -25,7 +25,11 @@
 package org.openjdk.jcstress.tests.future;
 
 import org.openjdk.jcstress.annotations.Actor;
+import org.openjdk.jcstress.annotations.Description;
+import org.openjdk.jcstress.annotations.Expect;
 import org.openjdk.jcstress.annotations.JCStressTest;
+import org.openjdk.jcstress.annotations.Outcome;
+import org.openjdk.jcstress.annotations.Ref;
 import org.openjdk.jcstress.annotations.State;
 import org.openjdk.jcstress.infra.results.IntResult1;
 
@@ -36,6 +40,10 @@
 import java.util.concurrent.TimeoutException;
 
 @JCStressTest
+@Description("Tests if FutureTask.set() is racy.")
+@Outcome(id = "[-1]", expect = Expect.FORBIDDEN,  desc = "Future.get() had returned, but the value is null.")
+@Outcome(id = "[42]", expect = Expect.ACCEPTABLE, desc = "Future.get() returns, and the value is intact.")
+@Ref("http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7132378")
 public class FutureTaskSetTest {
 
     @Actor
--- a/tests-custom/src/main/resources/org/openjdk/jcstress/desc/future.xml	Tue Aug 12 14:18:24 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-<!--
-
-    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>
-
-    <test name="org.openjdk.jcstress.tests.future.FutureTaskSetTest">
-        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>
-        <description>
-            Tests if FutureTask.set() is racy.
-        </description>
-        <case>
-            <match>[-1]</match>
-            <expect>FORBIDDEN</expect>
-            <description>
-                Future.get() had returned, but the value is null.
-            </description>
-            <refs>
-                <url>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7132378</url>
-            </refs>
-        </case>
-        <case>
-            <match>[42]</match>
-            <expect>ACCEPTABLE</expect>
-            <description>
-                Future.get() returns, and the value is intact.
-            </description>
-        </case>
-        <unmatched>
-            <expect>FORBIDDEN</expect>
-            <description>
-                This case is not expected.
-            </description>
-        </unmatched>
-    </test>
-
-
-</testsuite>