Commit f87ced20 authored by Ivo Anjo's avatar Ivo Anjo

Update libjavartm-dummy with new doTransactionally API, and added some tests for it

parent 02398f9c
......@@ -56,3 +56,8 @@ JNIEXPORT void JNICALL Java_javartm_Transaction_abort__(JNIEnv *env, jclass cls)
JNIEXPORT void JNICALL Java_javartm_Transaction_abort__J(JNIEnv *env, jclass cls, jlong reason) {
JNIEXPORT jobject JNICALL Java_javartm_Transaction_doTransactionally(JNIEnv *env, jclass cls, jobject runnable, jboolean warmup) {
return NULL;
* javartm: a Java library for Restricted Transactional Memory
* Copyright (C) 2013 Ivo Anjo <>
* This file is part of javartm.
* javartm is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* javartm is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with javartm. If not, see <>.
package javartm.tests;
import javartm.Transaction;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.junit.Assert;
/** Tests for the dummy fallback library, on machines that have no RTM support **/
public class DummyTest1 {
public static void checkRtmStatus() {
Assert.assertFalse(DummyTest1.class.getName() + " can only be run on machines without RTM support",
@Test(expected=RuntimeException.class) public void testInTransaction() { Transaction.inTransaction(); }
@Test(expected=RuntimeException.class) public void testBegin() { Transaction.begin(); }
@Test(expected=RuntimeException.class) public void testCommit() { Transaction.commit(); }
@Test(expected=RuntimeException.class) public void testAbort() { Transaction.abort(); }
@Test(expected=RuntimeException.class) public void testAbort2() { Transaction.abort(0); }
@Test(expected=RuntimeException.class) public void testDoTransactionally() { Transaction.doTransactionally(null); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment