Package com.alibaba.citrus.service.resource.support

Examples of com.alibaba.citrus.service.resource.support.ResourceAdapter


        com.alibaba.citrus.service.resource.Resource resource = createMock(com.alibaba.citrus.service.resource.Resource.class);

        expect(resource.lastModified()).andReturn(123L);
        replay(resource);

        ResourceAdapter adapter = new ResourceAdapter("/test", resource);

        assertEquals(123L, adapter.lastModified());
    }
View Full Code Here


    @Test
    public void resourceAdapter_hashCodeAndEquals() {
        initContext("beans.xml");

        ResourceAdapter r1 = (ResourceAdapter) context.getResource("/webroot/beans.xml");
        ResourceAdapter r2 = (ResourceAdapter) context.getResource("/webroot/beans.xml");

        assertHashCodeAndEquals(r1, r2);

        r2 = (ResourceAdapter) context.getResource("/basedir/beans.xml"); // ����ͬһ����

        assertNotSame(r1, r2);
        assertNotSame(r1.getResource(), r2.getResource());

        assertThat(r1.hashCode(), not(equalTo(r2.hashCode())));
        assertThat(r1.getResource().hashCode(), not(equalTo(r2.getResource().hashCode())));

        assertThat(r1, not(equalTo(r2)));
        assertThat(r1.getResource(), not(equalTo(r2.getResource())));
    }
View Full Code Here

        com.alibaba.citrus.service.resource.Resource resource = createMock(com.alibaba.citrus.service.resource.Resource.class);

        expect(resource.lastModified()).andReturn(123L);
        replay(resource);

        ResourceAdapter adapter = new ResourceAdapter("/test", resource);

        assertEquals(123L, adapter.lastModified());
    }
View Full Code Here

    @Test
    public void resourceAdapter_hashCodeAndEquals() {
        initContext("beans.xml");

        ResourceAdapter r1 = (ResourceAdapter) context.getResource("/webroot/beans.xml");
        ResourceAdapter r2 = (ResourceAdapter) context.getResource("/webroot/beans.xml");

        assertHashCodeAndEquals(r1, r2);

        r2 = (ResourceAdapter) context.getResource("/basedir/beans.xml"); // 不是同一类型

        assertNotSame(r1, r2);
        assertNotSame(r1.getResource(), r2.getResource());

        assertThat(r1.hashCode(), not(equalTo(r2.hashCode())));
        assertThat(r1.getResource().hashCode(), not(equalTo(r2.getResource().hashCode())));

        assertThat(r1, not(equalTo(r2)));
        assertThat(r1.getResource(), not(equalTo(r2.getResource())));
    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.resource.support.ResourceAdapter

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.