Examples of createKey()


Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()

    }

    // Test with a resource key instead of a file key
    try
    {
      key = manager.createKey("res://org/pentaho/reporting/libraries/resourceloader/test1.properties"); //$NON-NLS-1$
      serializedVersion = fileResourceLoader.serialize(key, key);
      fail("The resource key should not handles by the file resource loader"); //$NON-NLS-1$
    }
    catch (IllegalArgumentException iae)
    {
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()

    {
      // success
    }

    // Create a key from the temp file
    key = manager.createKey(tempFile);
    serializedVersion = fileResourceLoader.serialize(key, key);
    assertNotNull("The returned key should not be null", key); //$NON-NLS-1$
    assertTrue("Serialized verison does not start with the correct header", serializedVersion //$NON-NLS-1$
        .startsWith(STRING_SERIALIZATION_PREFIX));
    assertTrue("Serialized version does not contain the correct schema information", serializedVersion //$NON-NLS-1$
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()

        "Serialized version should contain the filename", serializedVersion.endsWith(tempSubFile.getCanonicalPath())); //$NON-NLS-1$

    // Create a key with factory parameters
    factoryParameters.put(new FactoryParameterKey("this"), "that");
    factoryParameters.put(new FactoryParameterKey("null"), null);
    key = manager.createKey(tempFile, factoryParameters);
    serializedVersion = fileResourceLoader.serialize(key, key);

    assertNotNull("The returned key should not be null", key); //$NON-NLS-1$
    assertTrue("Serialized verison does not start with the correct header", serializedVersion //$NON-NLS-1$
        .startsWith(STRING_SERIALIZATION_PREFIX));
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()

    final ResourceManager manager = new ResourceManager();
    manager.registerDefaults();
  
    factoryParams.put(new FactoryParameterKey("this"), "that");
    factoryParams.put(new FactoryParameterKey("null"), null);
    final ResourceKey originalKey = manager.createKey(tempFile, factoryParams);
   
    final String serializedVersion = fileResourceLoader.serialize(null, originalKey);
    final ResourceKey duplicateKey = fileResourceLoader.deserialize(null, serializedVersion);
    assertNotNull(duplicateKey);
    assertTrue(originalKey.equals(duplicateKey));
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()

   
    // Test failure - not a Classloader resource key
    try
    {
      final File tempFile = File.createTempFile("junit-test", ".tmp");
      final ResourceKey tempKey = manager.createKey(tempFile);
      resourceLoader.serialize(null, tempKey);
      fail("The Classloader Resource Loader should fail when handling a non-classloader resource key");
    }
    catch(IllegalArgumentException iae)
    {
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()

      // success
    }

    // Create key
    final String key1source = "res://org/pentaho/reporting/libraries/resourceloader/test1.properties";
    final ResourceKey key1 = manager.createKey(key1source);
    assertNotNull(key1);

    // Serialize the key
    final String serKey1 = resourceLoader.serialize(null, key1);
    assertNotNull("The returned key should not be null", serKey1); //$NON-NLS-1$
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()

    // Serialize a key with factory parameters
    final Map<ParameterKey, Object> factoryParams = new HashMap<ParameterKey, Object>();
    factoryParams.put(new FactoryParameterKey("this"), "that");
    factoryParams.put(new FactoryParameterKey("null"), null);
    final ResourceKey key3 = manager.createKey(key1source, factoryParams);
    assertNotNull(key3);

    final String serKey3 = resourceLoader.serialize(null, key3);
    assertEquals("resourcekey:org.pentaho.reporting.libraries.resourceloader" +
        ".loader.resource.ClassloaderResourceLoader;" +
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()

    // Test with a file instead of a URL
    try
    {
      final File tempFile = File.createTempFile("unittest", "test");
      tempFile.deleteOnExit();
      key = manager.createKey(tempFile);
      serializedVersion = resourceLoader.serialize(key, key);
      fail("The resource key should not handled by the URL resource loader"); //$NON-NLS-1$
    }
    catch (IllegalArgumentException iae)
    {
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()

    {
      // success
    }

    // Create a key from the temp file
    key = manager.createKey(new URL(URL1));
    serializedVersion = resourceLoader.serialize(key, key);
    assertNotNull("The returned key should not be null", key); //$NON-NLS-1$
    assertTrue("Serialized verison does not start with the correct header", serializedVersion //$NON-NLS-1$
        .startsWith(STRING_SERIALIZATION_PREFIX));
    assertTrue("Serialized version does not contain the correct schema information", serializedVersion //$NON-NLS-1$
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()

    assertTrue("Serialized version should contain the filename", serializedVersion.endsWith(URL2)); //$NON-NLS-1$

    // Create a key with factory parameters
    factoryParameters.put(new FactoryParameterKey("this"), "that");
    factoryParameters.put(new FactoryParameterKey("null"), null);
    key = manager.createKey(new URL(URL1), factoryParameters);
    serializedVersion = resourceLoader.serialize(key, key);

    assertEquals("resourcekey:org.pentaho.reporting.libraries.resourceloader.loader.URLResourceLoader;" +
        "http://www.pentaho.com/index.html;\"\"\"f:this=that\"\":\"\"f:null=\"\"\"", serializedVersion);
  }
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.