Search in sources :

Example 1 with ResourceFile

use of com.tvd12.ezyhttp.server.core.resources.ResourceFile in project ezyhttp by youngmonkeys.

the class MessageReaderTest method readInJarTest.

@Test
public void readInJarTest() {
    // given
    MessageReader reader = new MessageReader() {

        protected List<ResourceFile> listResourceFiles(String folderPath) {
            List<ResourceFile> answer = super.listResourceFiles(folderPath);
            answer.add(new ResourceFile("messages/messages.properties", "messages/messages.properties", true));
            return answer;
        }
    };
    String folderPath = "messages";
    // when
    Map<String, Properties> map = reader.read(folderPath);
    // then
    Asserts.assertEquals(4, map.size());
    Asserts.assertEquals(2, map.get("").size());
    Asserts.assertEquals(1, map.get("en_US").size());
    Asserts.assertEquals(1, map.get("vi").size());
}
Also used : ResourceFile(com.tvd12.ezyhttp.server.core.resources.ResourceFile) MessageReader(com.tvd12.ezyhttp.server.core.view.MessageReader) Properties(java.util.Properties) Test(org.testng.annotations.Test)

Aggregations

ResourceFile (com.tvd12.ezyhttp.server.core.resources.ResourceFile)1 MessageReader (com.tvd12.ezyhttp.server.core.view.MessageReader)1 Properties (java.util.Properties)1 Test (org.testng.annotations.Test)1