Package chapter10.helloWorld

Examples of chapter10.helloWorld.HelloWorld


    Context context = new ContextBase();

    Map<Pattern, Action> ruleMap = new HashMap<Pattern, Action>();

    // we start with the rule for the top-most (root) element
    ruleMap.put(new Pattern("*/computation"), new ComputationAction1());

    // Associate "/new-rule" pattern with NewRuleAction from the
    // org.apache.joran.action package.
    //
    // We will let the XML file to teach the Joran interpreter about new rules
View Full Code Here


    Context context = new ContextBase();

    Map<Pattern, Action> ruleMap = new HashMap<Pattern, Action>();

    // we start with the rule for the top-most (root) element
    ruleMap.put(new Pattern("*/computation"), new ComputationAction1());

    // Associate "/new-rule" pattern with NewRuleAction from the
    // org.apache.joran.action package.
    //
    // We will let the XML file to teach the Joran interpreter about new rules
View Full Code Here

import helloWorld.HelloWorld;

public class HelloWorldTest {
  @Test
  public void testHellowWorld(){
    HelloWorld hello = new HelloWorld();
    assertEquals("A test for Hello World String", "Hello World", hello.sayHello());
  }
View Full Code Here

*/
public class HelloWorldPrototypeTest {

    @Test
    public void testHelloWorldPrototype(){
        HelloWorld helloWorld = HelloWorldPrototype.PROTOTYPE.clone();
        assertThat(helloWorld.helloWorld(),is("Hello Prototype!"));
    }
View Full Code Here

*/
public class HelloWorldSingletonTest {

    @Test
    public void testHelloWorldSingleton(){
        HelloWorld helloWorld = HelloWorldSingleton.instance();
        assertThat(helloWorld.helloWorld(),is("Hello Singleton!"));
    }
View Full Code Here

public class FactoryMethodHelloWorldFactoryTest {

    @Test
    public void testFactoryMethodHelloWorldFactory(){
        HelloWorldFactory helloWorldFactory = new HelloWorldFactory();
        HelloWorld helloWorld = helloWorldFactory.createHelloWorld();
        assertThat(helloWorld.helloWorld(),is("Hello World!"));
        FactoryMethodHelloWorldFactory factoryMethodHelloWorldFactory = new FactoryMethodHelloWorldFactory();
        helloWorld = factoryMethodHelloWorldFactory.createHelloWorld();
        assertThat(helloWorld.helloWorld(),is("Hello Factory Method!"));
    }
View Full Code Here

*/
public class HelloWorldBuilderTest {

    @Test
    public void testHelloWorldBuilder(){
        HelloWorld builderHelloWorld = HelloWorldBuilder.builder()
                .interjection("Hello")
                .object("Builder").getHelloWorld();
        assertThat(builderHelloWorld.helloWorld(),is("Hello Builder!"));

        HelloWorld helloWorld = HelloWorldBuilder.builder()
                .interjection("Hello")
                .object("World").getHelloWorld();
        assertThat(helloWorld.helloWorld(),is("Hello World!"));
    }
View Full Code Here

*/
public class FactoryMethodHelloWorldFactory extends HelloWorldFactory{

    @Override
    public HelloWorld createHelloWorld() {
        return new HelloWorld() {
            @Override
            public String helloWorld() {
                return "Hello Factory Method!";
            }
        };
View Full Code Here

* @author yihua.huang@dianping.com
*/
public class HelloWorldFactory {

    public HelloWorld createHelloWorld(){
        return new HelloWorld() {
            @Override
            public String helloWorld() {
                return "Hello World!";
            }
        };
View Full Code Here

*/
public class HelloWorldBridgeTest {

    @Test
    public void testHelloWorldAdapter(){
        HelloWorld bridgeHelloWorld = new HelloWorldBridge(new JavaHelloWorldImpl());
        assertThat(bridgeHelloWorld.helloWorld(),is("Hello Java!"));
        bridgeHelloWorld = new HelloWorldBridge(new DesignPatternWorldImpl());
        assertThat(bridgeHelloWorld.helloWorld(),is("Hello Bridge!"));
    }
View Full Code Here

TOP

Related Classes of chapter10.helloWorld.HelloWorld

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.