Package test

Source Code of test.TestConfig

package test;

import static org.hamcrest.Matchers.is;

import org.junit.Assert;
import org.junit.Test;

import com.firefly.template.Config;
import com.firefly.template.parser.ViewFileReader;

public class TestConfig {

  @Test
  public void test() {
    Config config = new Config();
    config.setViewPath("/page");
    Assert.assertThat(config.getCompiledPath(), is("/page/_compiled_view"));
   
    config.setViewPath("/page2/");
    Assert.assertThat(config.getCompiledPath(), is("/page2/_compiled_view"));
  }
 
  public static void main(String[] args) {
    String path = "F:/develop/workspace2/firefly-template/src/test/page";
//    String path = "/Users/qiupengtao/Documents/workspace/firefly-project/firefly-template/src/test/page";
    Config config = new Config();
    config.setViewPath(path);
    ViewFileReader reader = new ViewFileReader();
    reader.setConfig(config);
    reader.readAndBuild();
  }
}
TOP

Related Classes of test.TestConfig

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.