Package com.alibaba.otter.shared.common.utils.code

Examples of com.alibaba.otter.shared.common.utils.code.ResourceBundleUtil


    // 测试资源文件没有找到
    @Test
    public void testResourceBundleNotFound() {
        try {
            new ResourceBundleUtil("code/NotFound");
        } catch (RuntimeException e) {
            want.object(e).clazIs(MissingResourceException.class);
        }
    }
View Full Code Here


    }

    // 测试不同key下的value情况
    @Test
    public void testResourceBundle() {
        ResourceBundleUtil util = new ResourceBundleUtil(RESOURCE_LOCATION);
        // key为空
        want.object(util.getMessage(null)).isNull();
        // key对应的value为空字符串
        want.string(util.getMessage("key1")).isEqualTo("");
        // 静态value的测试
        want.string(util.getMessage("key2")).isEqualTo("value2");
        // 动态渲染的测试
        want.string(util.getMessage("key3", "stone")).isEqualTo("value3,stone");
    }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.common.utils.code.ResourceBundleUtil

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.