Package helloworld

Examples of helloworld.Helloworld


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

*/
public class HelloWorldFlyWeightTest {

    @Test
    public void testHelloWorldFlyWeight(){
        HelloWorld helloWorld = HelloWorldFlyWeightFactory.instance().createHelloWorld("Hello Flyweight!");
        assertThat(helloWorld.helloWorld(),is("Hello Flyweight!"));
        helloWorld = HelloWorldFlyWeightFactory.instance().createHelloWorld("Hello Flyweight!");
        assertThat(helloWorld.helloWorld(),is("Hello Flyweight!"));
    }
View Full Code Here

*/
public class HelloWorldAdapterTest {

    @Test
    public void testHelloWorldAdapter(){
        HelloWorld adapterHelloWorld = new HelloWorldAdapter(new HelloAdapterDesignPattern());
        assertThat(adapterHelloWorld.helloWorld(),is("Hello Adapter!"));
    }
View Full Code Here

TOP

Related Classes of 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.