Package org.fto.jthink.util

Examples of org.fto.jthink.util.PackageResourceReader


  public ResourceManager initResourceManager() throws Exception{
    /* 初始化配置文件 */
    Configuration config =
      new Configuration(
          XMLHelper.load(
               new PackageResourceReader(this.getClass()).getResource("/fto-jthink.xml").openStream()));
 
    /* 初始化日志管理器 */
    LogManager.configure(config);
//    /* 返回日志处理接口 */
//    logger = LogManager.getLogger(SQLTestCase.class);
View Full Code Here


  public void testGetResource() {
    System.out.println("\n[正在测试方法: PackageResourceReaderTestCase.getResource()...]");

    URL url;
    /* 测试资源, 绝对路径 */
    url = new PackageResourceReader(this.getClass()).getResource("/org/fto/jthink/util/PackageResourceReader.class");
    System.out.println(url);
    assertNull(url);

    url = new PackageResourceReader(this.getClass()).getResource("/org/fto/jthink/util/UtilSuite.class");
    System.out.println(url);
    assertNotNull(url);
   
    url = new PackageResourceReader(PackageResourceReader.class).getResource("/org/fto/jthink/util/PackageResourceReader.class");
    System.out.println(url);
    assertNotNull(url);
   
   
    url = new PackageResourceReader(Long.class).getResource("/java/lang/Long.class");
    System.out.println(url);
    assertNotNull(url);

    url = new PackageResourceReader(this.getClass()).getResource("/META-INF/DbClrBrk.gif");
    System.out.println(url);
    //assertNotNull(url);
   
   
    url = new PackageResourceReader(Long.class).getResource("/META-INF/MANIFEST.MF");
    System.out.println(url);
    //assertNotNull(url);

    url = new PackageResourceReader(this.getClass()).getResource("/META-INF/MANIFEST.MF");
    System.out.println(url);
    //assertNotNull(url);
 
    /* 测试资源, 相对路径 */
    url = new PackageResourceReader(this.getClass()).getResource("DbCllStk.gif");
    System.out.println(url);
    //assertNotNull(url);
   
    url = new PackageResourceReader(this.getClass()).getResource("../DbBrkAt.gif");
    System.out.println(url);
    //assertNotNull(url);
   
    System.out.println("getContextClassLoader:"+Thread.currentThread().getContextClassLoader().getResource("META-INF/MANIFEST.MF"));
    System.out.println("getClassLoader:"+this.getClass().getClassLoader().getResource("META-INF/MANIFEST.MF"));
View Full Code Here

TOP

Related Classes of org.fto.jthink.util.PackageResourceReader

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.