alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Jetty example source code file (TestAjpParser.java)

This example Jetty source code file (TestAjpParser.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Jetty tags/keywords

brown, dog, exception, exception, fox, jumps, over, over, quick, the, the, to, treemap, treemap, util

The Jetty TestAjpParser.java source code

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);

        }



    }
    


}

Other Jetty examples (source code examples)

Here is a short list of links related to this Jetty TestAjpParser.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.