Package net.sf.jportlet.util

Examples of net.sf.jportlet.util.ClasspathResourceLoader


        _descriptor          = proxy.getDescriptor(  );
        _application         = application;
        _servletContext      = servletContext;
        _log                 = new PortletLogImpl( Portlet.class.getName(  ) + ":" + proxy.getDescriptor(  ).getName(  ) );
        _webResourceLoader   = new WebResourceLoader( _descriptor.getContextPath(  ), servletContext );
        _classResourceLoader = new ClasspathResourceLoader( _descriptor.getPortletClass(  ) );
    }
View Full Code Here


  }
 
  public void testGetResourcePath() throws Exception
  {
    String xpath;
    ClasspathResourceLoader cp = new ClasspathResourceLoader(ClasspathResourceLoaderTest.class);
   
    xpath = cp.getResourcePath("res.txt");
    assertEquals( "net/sf/jportlet/util/test/res.txt", xpath);

    /* Markup */   
    xpath = cp.getResourcePath("res.html", Portlet.Markup.HTML.toString());
    assertEquals( "net/sf/jportlet/util/test/html/res.html", xpath);
     
    xpath = cp.getResourcePath("res.txt", Portlet.Markup.HTML.toString());
    assertEquals( "net/sf/jportlet/util/test/res.txt", xpath);
   
    /* Language */
    xpath = cp.getResourcePath("res.html", Portlet.Markup.HTML.toString(), Locale.ENGLISH);
    assertEquals( "net/sf/jportlet/util/test/html/res_en.html", xpath);
   
    xpath = cp.getResourcePath("res.txt", Portlet.Markup.HTML.toString(), Locale.ENGLISH);
    assertEquals( "net/sf/jportlet/util/test/res.txt", xpath);
   
    /* Locale */
    xpath = cp.getResourcePath("res.html", Portlet.Markup.HTML.toString(), Locale.US );
    assertEquals( "net/sf/jportlet/util/test/html/res_en_US.html", xpath);
   
    xpath = cp.getResourcePath("res.txt", Portlet.Markup.HTML.toString(), Locale.US);
    assertEquals( "net/sf/jportlet/util/test/res.txt", xpath);
  }
View Full Code Here

TOP

Related Classes of net.sf.jportlet.util.ClasspathResourceLoader

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.