Created
February 24, 2014 10:08
-
-
Save hstaudacher/9184996 to your computer and use it in GitHub Desktop.
A simple JUnit Rule to setup and teardown RWT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* Copyright (c) 2014 EclipseSource and others. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: | |
* EclipseSource - initial API and implementation | |
******************************************************************************/ | |
package com.eclipsesource.tabris.test; | |
import org.eclipse.rap.rwt.testfixture.Fixture; | |
import org.junit.rules.TestRule; | |
import org.junit.runner.Description; | |
import org.junit.runners.model.Statement; | |
public class RWTRule implements TestRule { | |
@Override | |
public Statement apply( final Statement base, Description description ) { | |
return new Statement() { | |
@Override | |
public void evaluate() throws Throwable { | |
try { | |
Fixture.setUp(); | |
base.evaluate(); | |
} finally { | |
Fixture.tearDown(); | |
} | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment