Examples of ResourceLoader


Examples of org.dozer.util.ResourceLoader

   * This tests checks that the customconverterparam reaches the
   * fieldmapping.     
   */
  @Test
  public void testParseCustomConverterParam() throws Exception {
    ResourceLoader loader = new ResourceLoader();
    URL url = loader.getResource("fieldCustomConverterParam.xml");

    Document document = XMLParserFactory.getInstance().createParser().parse(url.openStream());
    parser = new XMLParser(document);
   
    MappingFileData mappings = parser.load();
View Full Code Here

Examples of org.easetech.easytest.io.ResourceLoader

        }
    }

    private static Properties getProperties(TestProperties resource, Class<?> configClass) {
        java.util.Properties properties = new java.util.Properties();
        ResourceLoader resourceLoader = new ResourceLoaderStrategy(configClass);
        for (String resourcePath : resource.value()) {
            Resource fileResource = resourceLoader.getResource(resourcePath);
            if (fileResource.exists()) {

                try {
                    properties.load(fileResource.getInputStream());
                } catch (IOException e) {
View Full Code Here

Examples of org.easetech.easytest.util.ResourceLoader

    private Map<String, List<Map<String, Object>>> loadXMLData(final List<String> dataFiles) throws IOException {
        Map<String, List<Map<String, Object>>> data = null;
        Map<String, List<Map<String, Object>>> finalData = new HashMap<String, List<Map<String, Object>>>();
        for (String filePath : dataFiles) {
            try {
                ResourceLoader resource = new ResourceLoader(filePath);
                data = load(resource.getInputStream());
            } catch (FileNotFoundException e) {
                LOG.error("The specified file was not found. The path is : {}", filePath);
                LOG.error("Continuing with the loading of next file.");
                continue;
            } catch (IOException e) {
View Full Code Here

Examples of org.eclipse.rap.rwt.service.ResourceLoader

    String currentTheme = ( String )RWT.getUISession().getAttribute( CURRENT_THEME_ID );
    assertEquals( Constants.THEME_ID_ANDROID, currentTheme );
  }

  private void registerTheme( String themeId ) throws IOException {
    ResourceLoader resourceLoader = new ResourceLoader() {

      @Override
      public InputStream getResourceAsStream( String resourceName ) throws IOException {
        return new ByteArrayInputStream( "".getBytes() );
      }
View Full Code Here

Examples of org.eclipse.rap.rwt.service.ResourceLoader

    String currentTheme = ( String )RWT.getUISession().getAttribute( CURRENT_THEME_ID );
    assertEquals( Constants.THEME_ID_SWT, currentTheme );
  }

  private void registerTheme( String themeId ) throws IOException {
    ResourceLoader resourceLoader = new ResourceLoader() {

      @Override
      public InputStream getResourceAsStream( String resourceName ) throws IOException {
        return new ByteArrayInputStream( "".getBytes() );
      }
View Full Code Here

Examples of org.g4studio.core.resource.ResourceLoader

        return null;
      }
     
     
     
      ResourceLoader loader = null;
      isCache = resourceConfig.isCache();
      loader = loaderMapping.mapping(resourceConfig.getLoaderName());
 
      Resource result = cacheManager.get(pUri);
   
      if ( result != null ){ 
        if ( checkModified == false ){//不检查修改
          return result;
        }
        //检查资源是否已修改
        long lastModified = result.getLastModified();
        long newModified = loader.getLastModified(pUri);
        if ( newModified > lastModified){
          Object keyLock = null;
          synchronized( LOCK ){
            keyLock = getKeyLock(pUri);
          }
View Full Code Here

Examples of org.impalaframework.spring.resource.ResourceLoader

    public final Resource[] getSpringConfigResources(String applicationId, ModuleDefinition moduleDefinition, ClassLoader classLoader) {
       
        ModuleLocationsResourceLoader loader = new ModuleLocationsResourceLoader();
        Collection<ResourceLoader> resourceLoaders = getSpringLocationResourceLoaders();
        ResourceLoader compositeResourceLoader = new CompositeResourceLoader(resourceLoaders);
        loader.setResourceLoader(compositeResourceLoader);
        return loader.getSpringLocations(moduleDefinition, classLoader);
    }
View Full Code Here

Examples of org.jbehave.core.io.ResourceLoader

    }

    @Test
    public void shouldCreateExamplesTableFromResourceInput() {
        // Given
        ResourceLoader resourceLoader = mock(ResourceLoader.class);
        ExamplesTableFactory factory = new ExamplesTableFactory(resourceLoader);
       
        // When
        String resourcePath = "/path/to/table";
        when(resourceLoader.loadResourceAsText(resourcePath)).thenReturn(tableAsString);
        ExamplesTable examplesTable = factory.createExamplesTable(resourcePath);
       
        // Then
        assertThat(examplesTable.asString(), equalTo(tableAsString));
    }
View Full Code Here

Examples of org.jbehave.core.io.ResourceLoader

    }
  }

  private ResourceImporter createImporter() {
    ResourceIndexer indexer = newResourceIndexer();
    ResourceLoader loader = newResourceLoader();
    getLog().info(
        "Creating importer to filesystem using REST provider "
            + restProvider + " with resourcesPath " + resourcesPath
            + " and resourcesExt " + resourcesExt);
    return new ImportToFilesystem(indexer, loader, resourcesPath, resourcesExt);
View Full Code Here

Examples of org.jbehave.core.io.ResourceLoader

    @Test
    public void canImportToFilesystem() throws IOException {

        // Given
        ResourceIndexer indexer = mock(ResourceIndexer.class);
        ResourceLoader loader = mock(ResourceLoader.class);
        String rootURI = "http://wiki";
        Map<String, Resource> index = new HashMap<String, Resource>();
        index.put("one", new Resource(rootURI + "/one"));
        index.put("two", new Resource(rootURI + "/two"));
        when(indexer.indexResources(rootURI)).thenReturn(index);
        String text1 = "story text 1";
        when(loader.loadResourceAsText(index.get("one").getURI())).thenReturn(text1);
        String text2 = "story text 2";
        when(loader.loadResourceAsText(index.get("two").getURI())).thenReturn(text2);

        // When
        String targetPath = "target/stories";
        String targetExt = ".story";
        ResourceImporter importer = new ImportToFilesystem(indexer, loader, targetPath, targetExt);
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.