Examples of DefaultResourceLoader


Examples of org.springframework.core.io.DefaultResourceLoader

*/
public class ClassUtilsTest {

  @Test
  public void testParentLastClassLoading() throws Exception {
    Resource jar = new DefaultResourceLoader().getResource("class-v1.jar");
    SomeClass v2 = new SomeClass();
    assertEquals("Class-v2", System.getProperty(SomeClass.LAST_LOADED));
    assertNotNull(System.getProperty(SomeClass.CLASS_LOADED + ".2"));

    // use v2 CL as a parent
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

    assertFalse(v2.getClass().equals(obj.getClass()));
  }

  // disabled test
  public void testNestedClass() throws Exception {
    Resource jar = new DefaultResourceLoader().getResource("jar-with-classes.jar");

    Object obj = loadFromJar(jar, getClass().getClassLoader(), "test.SomeNestedClass");

    // check the jar classes are preferred
    assertEquals("NestedClass", System.getProperty(SomeClass.LAST_LOADED));
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

    assertFalse(org.springframework.util.ClassUtils.isPresent(obj.getClass().getName(), getClass().getClassLoader()));
  }

  @Test
  public void testNestedLib() throws Exception {
    Resource jar = new DefaultResourceLoader().getResource("jar-with-libs.jar");

    Object obj = loadFromJar(jar, getClass().getClassLoader(), "test.SomeLibClass");

    // check the jar classes are preferred
    assertEquals("LibClass", System.getProperty(SomeClass.LAST_LOADED));
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

    assertFalse(org.springframework.util.ClassUtils.isPresent(obj.getClass().getName(), getClass().getClassLoader()));
  }

  @Test
  public void testMainClassDiscovery() throws Exception {
    Resource jar = new DefaultResourceLoader().getResource("some-tool.jar");
    String mainClass = ExecutionUtils.mainClass(jar);
    assertEquals("test.SomeTool", mainClass);
  }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

   * Cr�ation la liste de mapping des types
   */
  public void afterPropertiesSet() throws Exception {
    // Recuperer les fichiers de mapping
    List<String> locations = mapper.getMappingFiles();
    DefaultResourceLoader resourcesLoader = new DefaultResourceLoader();

    // Pour chaque fichier, on ajoute la class dans le map
    for( String location : locations ) {

      // Recuperer le fichier
      Resource resource = resourcesLoader.getResource(location);
      InputStream stream = resource.getURL().openStream();
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = dbf.newDocumentBuilder();
      Document doc = db.parse(stream);
      doc.getDocumentElement().normalize();
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

  /**
   * Create a new LocalizedResourceHelper with a DefaultResourceLoader.
   * @see org.springframework.core.io.DefaultResourceLoader
   */
  public LocalizedResourceHelper() {
    this.resourceLoader = new DefaultResourceLoader();
  }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

    public void setupBeans() throws Exception {
        if (applicationContext != null) {
            return;
        }
        applicationContext = new GenericApplicationContext();
        resourceLoader = new DefaultResourceLoader(getClass().getClassLoader());
        for (String beanDefinitionPath : getConfigLocations()) {
            XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(applicationContext);
            Resource resource = resourceLoader.getResource(beanDefinitionPath);
            reader.loadBeanDefinitions(resource);
        }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

      }
    } else if (type == ComponentDeclaration.UIMAFIT_ENGINE) {
      List<String> engines = new ArrayList<String>();
      ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(
              true);
      ResourceLoader resourceLoader = new DefaultResourceLoader(classloader);
      provider.setResourceLoader(resourceLoader);
      provider.addIncludeFilter(new AssignableTypeFilter(AnalysisComponent.class));

      String pack = complString.replaceAll("[.]", "/");
      if (pack.endsWith("/")) {
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

  /**
   * @param resourcePaths Resource paths to search in priority.
   */
  public RutaResourceLoader(String[] resourcePaths) {
    this.wrapped = new PathMatchingResourcePatternResolver(new ResourcePathResourceLoader(resourcePaths));
    this.fallback = new DefaultResourceLoader();
  }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

   
    abstract protected String getScriptMimeType();
   
    public void setUp() throws Exception
    {
        portletContext = new MockPortletContext(new DefaultResourceLoader());
        portletConfig = new MockPortletConfig(portletContext);
       
        for (Map.Entry<String, String> entry : getPortletInitParameters().entrySet())
        {
            portletConfig.addInitParameter(entry.getKey(), entry.getValue());
View Full Code Here
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.