Package net.paoding.rose.scanning.vfs

Source Code of net.paoding.rose.scanning.vfs.LoadScopeTest

package net.paoding.rose.scanning.vfs;

import org.apache.commons.lang.ArrayUtils;

import junit.framework.TestCase;
import net.paoding.rose.scanning.LoadScope;

public class LoadScopeTest extends TestCase {

    public void test1() {
        LoadScope scope = new LoadScope("controllers=com.xiaonei.game", "controllers");
        assertNull(scope.getScope("applicationContext"));
        assertTrue(ArrayUtils.isEquals(new String[] { "com.xiaonei.game", "net.paoding.rose" },
                scope.getScope("controllers")));
    }

    public void test2() {
        LoadScope scope = new LoadScope("controllers=com.xiaonei.game,net.paoding.rose.web",
                "controllers");
        assertNull(scope.getScope("applicationContext"));
        assertTrue(ArrayUtils.isEquals(new String[] { "com.xiaonei.game", "net.paoding.rose.web",
                "net.paoding.rose" }, scope.getScope("controllers")));
    }

    public void test3() {
        LoadScope scope = new LoadScope(
                "com.xiaonei.game;applicationContext=com.xiaonei.abc", "controllers");
        assertNotNull(scope.getScope("applicationContext"));
        assertTrue(ArrayUtils.isEquals(new String[] { "com.xiaonei.game", "net.paoding.rose" },
                scope.getScope("controllers")));
        assertTrue(ArrayUtils.isEquals(new String[] { "com.xiaonei.abc", "net.paoding.rose" },
                scope.getScope("applicationContext")));
    }
}
TOP

Related Classes of net.paoding.rose.scanning.vfs.LoadScopeTest

TOP
Copyright © 2018 www.massapi.com. 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.