⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testajpparser.java

📁 是离开的肌肤了卡机是离开的就富利卡及是了的开发及拉考试及的福利科技阿斯利康的肌肤莱卡及时的离开福建阿斯顿发
💻 JAVA
字号:
package org.mortbay.jetty.plugin.beanshell;

import junit.framework.TestCase;

import java.util.TreeMap;


public class TestAjpParser extends TestCase
{

    public void testBeanShellRun() throws Exception
    {
        TreeMap treeMap = new TreeMap();
        treeMap.put("param1", "The Quick Brown Fox Jumps Over To The Lazy Dog");
        treeMap.put("param2", "thequickbrownfoxjumpsovertothelazydog");


        StringBuffer script = new StringBuffer();


        script.append("\nString param1=(String) params.get(\"param1\");");
        script.append("\nString param2=(String) params.get(\"param2\");");
        script.append("\nSystem.out.println(\"\\nparam1 = \" + param1);");
        script.append("\nSystem.out.println(\"\\nparam2 = \" + param2);");
        script.append("\nSystem.out.println(\"\\n\\n\");");

        script.append("\nif(!\"The Quick Brown Fox Jumps Over To The Lazy Dog\".equals(param1)) " +
                "\nthrow new Exception(\"param1 is not correct\");");
        script.append("\nif(!\"thequickbrownfoxjumpsovertothelazydog\".equals(param2)) " +
                "\nthrow new Exception(\"param2 is not correct\");");


       

        BeanShellRunMojo mojo = new BeanShellRunMojo();
        mojo.setScript(script.toString());
        mojo.setParams(treeMap);
        
        try
        {
            mojo.execute();
            System.out.println("BeanShellTest: Ok");
            assertTrue(true);
        }
        catch(Exception e)
        {
            System.out.println("BeanShellTest: Error on Bean Shell Execution");
            assertTrue(false);

        }



    }
    


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -