Package helloworld.creational.abstract_factory

Examples of helloworld.creational.abstract_factory.SplitHelloWorldFactory


*/
public class AbstractFactoryTest {

    @Test
    public void testHelloWorld() throws InstantiationException, IllegalAccessException {
        SplitHelloWorldFactory splitHelloWorldFactory = AbstractFactory.select(AbstractFactory.Type.Java);
        assertThat(splitHelloWorldFactory.createHelloWorldObject().object(), is("Java"));
        assertThat(splitHelloWorldFactory.createHelloWorldInterjection().interjection(), is("Hello"));
        splitHelloWorldFactory = AbstractFactory.select(AbstractFactory.Type.DesignPattern);
        assertThat(splitHelloWorldFactory.createHelloWorldInterjection().interjection(), is("Hello"));
        assertThat(splitHelloWorldFactory.createHelloWorldObject().object(), is("Abstract Factory"));
    }
View Full Code Here


        System.out.println("We are creational patterns!");

        System.out.println("1. Abstract Factory: ");

        SplitHelloWorldFactory abstractFactory = AbstractFactory.select(AbstractFactory.Type.DesignPattern);
        HelloWorld abstractFactoryHelloWorld = new SplitHelloWorld(abstractFactory.createHelloWorldInterjection(),
                abstractFactory.createHelloWorldObject());
        System.out.println(abstractFactoryHelloWorld.helloWorld());

        System.out.println("2. Builder: ");
        HelloWorld builderHelloWorld = HelloWorldBuilder.builder()
                .interjection("Hello")
View Full Code Here

TOP

Related Classes of helloworld.creational.abstract_factory.SplitHelloWorldFactory

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.