测试用例判断如果不支持javascript engine 则直接跳过》

git-svn-id: http://code.alibabatech.com/svn/dubbo/trunk@117 1a56cb94-b969-4eaa-88fa-be21384802f2
This commit is contained in:
chao.liuc 2011-10-28 08:18:00 +00:00
parent 2b0966855c
commit 38788092a2
1 changed files with 7 additions and 0 deletions

View File

@ -19,6 +19,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.script.ScriptEngineManager;
import junit.framework.Assert;
import org.easymock.EasyMock;
@ -56,6 +58,8 @@ public class FileRouterEngineTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
private static boolean isScriptUnsupported = new ScriptEngineManager().getEngineByName("javascript") == null;
@Before
public void setUp() throws Exception {
@ -65,6 +69,7 @@ public class FileRouterEngineTest {
@Test
public void testRouteNotAvailable() {
if (isScriptUnsupported) return;
URL url = initUrl("notAvailablerule.javascript");
initInvocation("method1");
initDic(url);
@ -81,6 +86,7 @@ public class FileRouterEngineTest {
@Test
public void testRouteAvailable() {
if (isScriptUnsupported) return;
URL url = initUrl("availablerule.javascript");
initInvocation("method1");
initDic(url);
@ -97,6 +103,7 @@ public class FileRouterEngineTest {
@Test
public void testRouteByMethodName() {
if (isScriptUnsupported) return;
URL url = initUrl("methodrule.javascript");
{
initInvocation("method1");