All Downloads are FREE. Search and download functionalities are using the official Maven repository.

play.test.BaseTest Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package play.test;

import org.junit.Rule;
import org.junit.runner.RunWith;
import play.db.jpa.JPA;
import play.exceptions.UnexpectedException;

@RunWith(PlayJUnitRunner.class)
public class BaseTest extends org.junit.Assert {

    @Rule
    public PlayJUnitRunner.StartPlay startPlayBeforeTests = PlayJUnitRunner.StartPlay.rule();

    /**
     * Pause the current thread
     */
    public void pause(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException ex) {
            throw new UnexpectedException(ex);
        }
    }
    
    /**
     * Flush and clear the JPA session
     */
    @Deprecated
    public void clearJPASession() {
        JPA.em().flush();
        JPA.em().clear();
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy