Package com.dyuproject.ioc.test

Examples of com.dyuproject.ioc.test.Person


   
    public void testBasic() throws Exception
    {       
        String resource = "src/test/resources/com/dyuproject/ioc/test/basic.json";
        ApplicationContext ac = ApplicationContext.load(resource);
        Person person = (Person)ac.findPojo("person");
        assertTrue("John".equals(person.getFirstName()));
        assertTrue(20==person.getAge());
    }
View Full Code Here


    public void testImportBasic() throws Exception
    {
        String resource = "src/test/resources/com/dyuproject/ioc/test/import_basic.json";
        ApplicationContext ac = ApplicationContext.load(resource);
        assertTrue(ac.getPojo("person")==null);
        Person person = (Person)ac.findPojo("person");
        assertTrue("John".equals(person.getFirstName()));
        assertTrue(20==person.getAge());
       
        Person person1 = (Person)ac.getPojo("person1");
        assertTrue("John".equals(person1.getFirstName()));
        assertTrue(21==person1.getAge());
    }
View Full Code Here

   
    public void testReference() throws Exception
    {
        String resource = "src/test/resources/com/dyuproject/ioc/test/reference.json";
        ApplicationContext ac = ApplicationContext.load(resource);
        Person person2 = (Person)ac.findPojo("person2");
        assertTrue("John".equals(person2.getFirstName()));
        assertTrue(22==person2.getAge());
    }
View Full Code Here

   
    public void testImportReference() throws Exception
    {
        String resource = "src/test/resources/com/dyuproject/ioc/test/import_reference.json";
        ApplicationContext ac = ApplicationContext.load(resource);
        Person person3 = (Person)ac.findPojo("person3");
        assertTrue("John".equals(person3.getFirstName()));
        assertTrue(23==person3.getAge());
    }
View Full Code Here

   
    public void testImportBasicReference() throws Exception
    {
        String resource = "src/test/resources/com/dyuproject/ioc/test/import_basic_reference.json";
        ApplicationContext ac = ApplicationContext.load(resource);
        Person person = (Person)ac.findPojo("person");
        Person person1 = (Person)ac.findPojo("person1");
        Person person2 = (Person)ac.findPojo("person2");
        Person person3 = (Person)ac.findPojo("person3");
        Person person4 = (Person)ac.findPojo("person4");
        assertTrue(person!=null);
        assertTrue(person1!=null);
        assertTrue(person2!=null);
        assertTrue(person3!=null);
        assertTrue(person4!=null);
        assertTrue(person2==person3);
        assertTrue(20==person.getAge());
        assertTrue(21==person1.getAge());
        assertTrue(23==person3.getAge());
        assertTrue(24==person4.getAge());
    }
View Full Code Here

TOP

Related Classes of com.dyuproject.ioc.test.Person

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.