Java Code Examples for org.pentaho.reporting.libraries.resourceloader.ResourceManager#createKey()

The following examples show how to use org.pentaho.reporting.libraries.resourceloader.ResourceManager#createKey() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Prd3159IT.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private ResourceKey createImageKey() throws IOException, ResourceKeyCreationException {
  final ResourceManager resMgr = new ResourceManager();
  resMgr.registerDefaults();

  final ByteArrayOutputStream bout = new ByteArrayOutputStream();
  ImageIO.write( new BufferedImage( 20, 20, BufferedImage.TYPE_INT_ARGB ), "png", bout );

  final String mimeType = "image/png";
  final String pattern = "resources/image{0}.png"; // NON-NLS
  final Map<ParameterKey, Object> parameters = new HashMap<ParameterKey, Object>();
  parameters.put( ClassicEngineFactoryParameters.ORIGINAL_VALUE, "c:\\invalid dir\\test.png" );
  parameters.put( ClassicEngineFactoryParameters.MIME_TYPE, mimeType );
  parameters.put( ClassicEngineFactoryParameters.PATTERN, pattern );
  parameters.put( ClassicEngineFactoryParameters.EMBED, "true" ); // NON-NLS
  // create an embedded key in here.
  return resMgr.createKey( bout.toByteArray(), parameters );
}
 
Example 2
Source File: AbstractElementReadHandler.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private ResourceKey localizeKey( final ResourceManager resourceManager, final ResourceKey valueKey ) {
  final Object object = valueKey.getFactoryParameters().get( ClassicEngineFactoryParameters.EMBED );
  if ( "false".equals( object ) ) {
    return valueKey;
  }
  if ( "org.pentaho.reporting.libraries.docbundle.bundleloader.RepositoryResourceBundleLoader".equals( valueKey
      .getSchema() ) == false
      && object == null ) {
    return valueKey;
  }

  try {
    final ResourceData resourceData = resourceManager.load( valueKey );
    final byte[] resource = resourceData.getResource( resourceManager );
    return resourceManager.createKey( resource, valueKey.getFactoryParameters() );
  } catch ( ResourceException e ) {
    if ( logger.isDebugEnabled() ) {
      logger.info( "Unable to normalize embedded resource-key, using ordinary key-object instead.", e );
    } else {
      logger.info( "Unable to normalize embedded resource-key, using ordinary key-object instead." );
    }
  }
  return valueKey;
}
 
Example 3
Source File: DefaultProcessingContext.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * This constructor exists for test-case use only. If you use this to process a real report, most of the settings of
 * the report will be ignored and your export will not work as expected.
 */
public DefaultProcessingContext() {
  outputProcessorMetaData = new GenericOutputProcessorMetaData();
  resourceBundleFactory = new DefaultResourceBundleFactory();
  configuration = ClassicEngineBoot.getInstance().getGlobalConfig();
  resourceManager = new ResourceManager();
  reportEnvironment = new CachingReportEnvironment( new DefaultReportEnvironment( configuration ) );
  try {
    this.contentBase = resourceManager.createKey( new File( "." ) );
  } catch ( ResourceKeyCreationException rkce ) {
    this.contentBase = null;
  }
  formulaContext =
      DefaultFormulaContextFactory.INSTANCE.create( resourceBundleFactory.getLocale(), resourceBundleFactory
          .getTimeZone() );
  metaData = new MemoryDocumentMetaData();
  compatibilityLevel = -1;
}
 
Example 4
Source File: ReportGenerator.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Parses the report from a given URL.
 *
 * @param file
 *          the report definition location.
 * @param contentBase
 *          the report's context (used to load content that has been referenced with relative URLs).
 * @return the parsed report.
 * @throws ResourceException
 *           if parsing or loading failed for some reason.
 */
private MasterReport parse( final URL file, final URL contentBase ) throws ResourceException {
  final ResourceManager resourceManager = new ResourceManager();
  final ResourceKey contextKey = resourceManager.createKey( contentBase );

  // Build the main key. That key also contains all context/parse-time
  // parameters as they will influence the resulting report. It is not
  // wise to keep caching independent from that.
  final HashMap map = new HashMap();
  final Iterator it = this.helperObjects.keySet().iterator();
  while ( it.hasNext() ) {
    final String name = (String) it.next();
    map.put( new FactoryParameterKey( name ), helperObjects.get( name ) );
  }

  final ResourceKey key = resourceManager.createKey( file, map );
  final Resource resource = resourceManager.create( key, contextKey, MasterReport.class );
  return (MasterReport) resource.getResource();
}
 
Example 5
Source File: BigDataKettleFactoryTest.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
protected DataFactory createDataFactory( final String query ) throws ReportDataFactoryException {
  try {
    URL res = getClass().getResource( "embedded-row-gen.ktr" );
    assertNotNull( res );

    ResourceManager mgr = new ResourceManager();
    ResourceKey key = mgr.createKey( res );
    final byte[] resource = mgr.load( key ).getResource( mgr );
    final EmbeddedKettleTransformationProducer producer =
      new EmbeddedKettleTransformationProducer( new FormulaArgument[ 0 ], new FormulaParameter[ 0 ], "dummy-id",
        resource );

    final KettleDataFactory kettleDataFactory = new KettleDataFactory();
    kettleDataFactory.initialize( new DesignTimeDataFactoryContext() );
    kettleDataFactory.setQuery( DEFAULT, producer );
    return kettleDataFactory;
  } catch ( ResourceException re ) {
    throw new ReportDataFactoryException( "Failed to load raw-data", re );
  }
}
 
Example 6
Source File: FunctionUtilities.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
public static ResourceKey createURI( final String uri, final DocumentContext layoutProcess ) {
  try {
    final ResourceKey base = layoutProcess.getContextKey();
    final ResourceManager resourceManager =
      layoutProcess.getResourceManager();

    if ( base != null ) {
      try {
        return resourceManager.deriveKey( base, uri );
      } catch ( ResourceKeyCreationException ex ) {
        // ignore ..
      }
    }
    return resourceManager.createKey( uri );
  } catch ( Exception e ) {
    return null;
  }
}
 
Example 7
Source File: FileResourceLoaderTest.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * This is a happy path "round-trip" test which should demonstrate the serializing and deserializing a resource key
 * should produce the same key
 */
public void testSerializeDeserializeRoundtrip() throws Exception {
  final FileResourceLoader fileResourceLoader = new FileResourceLoader();
  final Map<ParameterKey, Object> factoryParams = new HashMap<ParameterKey, Object>();
  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 ) );
}
 
Example 8
Source File: SampleReport.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
public SampleReport( final File reportFile,
                     final ResourceManager resourceManager ) {
  this.lastAccessTime = reportFile.lastModified();
  this.fileSize = reportFile.length();
  this.fileName = reportFile.getAbsolutePath();

  try {
    final ResourceKey resourceKey = resourceManager.createKey( reportFile );
    this.reportName = computeNameFromMetadata( resourceManager, resourceKey );
    if ( StringUtils.isEmpty( this.reportName ) ) {
      this.reportName = computeNameFromReport( resourceManager, resourceKey );
    }
  } catch ( ResourceException re ) {
    // ignore ..
    this.reportName = null;
  }
}
 
Example 9
Source File: URLResourceLoaderTest.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * This is a happy path "round-trip" test which should demonstrate the serializing and deserializing a resource key
 * should produce the same key
 */
public void testSerializeDeserializeRoundtrip() throws Exception {
  final URLResourceLoader resourceLoader = new URLResourceLoader();
  final Map<ParameterKey, Object> factoryParams = new HashMap<ParameterKey, Object>();
  final ResourceManager manager = new ResourceManager();
  manager.registerDefaults();

  factoryParams.put( new FactoryParameterKey( "this" ), "that" );
  factoryParams.put( new FactoryParameterKey( "null" ), null );
  final ResourceKey originalKey = manager.createKey( URL1, factoryParams );

  final String serializedVersion = resourceLoader.serialize( null, originalKey );
  final ResourceKey duplicateKey = resourceLoader.deserialize( null, serializedVersion );
  assertNotNull( duplicateKey );
  assertTrue( originalKey.equals( duplicateKey ) );
}
 
Example 10
Source File: StyleSheetHandler.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Receive notification of a import statement in the style sheet.
 *
 * @param uri                 The URI of the imported style sheet.
 * @param media               The intended destination media for style information.
 * @param defaultNamespaceURI The default namespace URI for the imported style sheet.
 * @throws CSSException Any CSS exception, possibly wrapping another exception.
 */
public void importStyle( String uri,
                         SACMediaList media,
                         String defaultNamespaceURI )
  throws CSSException {
  //  instantiate a new parser and parse the stylesheet.
  final ResourceManager manager = getResourceManager();
  if ( manager == null ) {
    // there is no source set, so we have no resource manager, and thus
    // we do no parsing.
    //
    // This should only be the case if we parse style-values; in that case
    // include-statement are not supported anyway.
    return;
  }
  try {
    CSSParserContext.getContext().setDefaultNamespace( defaultNamespaceURI );
    final ResourceKey key;
    if ( source == null ) {
      key = manager.createKey( uri );
    } else {
      key = manager.deriveKey( source, uri );
    }

    final Resource res = manager.create( key, source, StyleSheet.class );
    if ( res == null ) {
      return;
    }
    final StyleSheet styleSheet = (StyleSheet) res.getResource();
    this.styleSheet.addStyleSheet( styleSheet );
  } catch ( ResourceException e ) {
    // ignore ..
  } finally {
    CSSParserContext.getContext().setStyleKeyRegistry( styleKeyRegistry );
    CSSParserContext.getContext().setSource( getSource() );
    CSSParserContext.getContext().setNamespaces( namespaces );
    CSSParserContext.getContext().setDefaultNamespace( defaultNamespace );
  }
}
 
Example 11
Source File: FunctionUtilities.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static CSSResourceValue loadResource( final DocumentContext process,
                                             final Object value,
                                             final Class[] type )
  throws FunctionEvaluationException {
  // ok, this is going to be expensive. Kids, you dont wanna try this at home ...
  final ResourceManager manager = process.getResourceManager();
  final ResourceKey baseKey = process.getContextKey();
  try {
    final ResourceKey key;
    if ( value instanceof ResourceKey ) {
      key = (ResourceKey) value;
    } else if ( baseKey == null ) {
      key = manager.createKey( value );
    } else if ( value instanceof String ) {
      key = manager.deriveKey( baseKey, (String) value );
    } else {
      throw new FunctionEvaluationException
        ( "Failed to create URI: Resource loading failed: Key not derivable" );
    }

    final Resource res = manager.create( key, baseKey, type );
    return new CSSResourceValue( res );
  } catch ( Exception e ) {
    throw new FunctionEvaluationException
      ( "Failed to create URI: Resource loading failed: " + e.getMessage(), e );
  }
}
 
Example 12
Source File: TrueTypeFontRegistryTest.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void testFontRegistration() throws IOException, ResourceKeyCreationException {
  final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
  final String[] names = ge.getAvailableFontFamilyNames();

  final TrueTypeFontRegistry tfr = new TrueTypeFontRegistry();
  tfr.registerDefaultFontPath();
  final int length = names.length;
  for ( int i = 0; i < length; i++ ) {
    final String name = names[ i ];
    final FontFamily fofam = tfr.getFontFamily( name );
    if ( "AmerType Md BT".equals( name ) ) {
      final FontSource fr = (FontSource) fofam.getFontRecord( false, false );
      final ResourceManager resourceManager = new ResourceManager();
      resourceManager.registerDefaults();

      final ResourceKey fontSource = resourceManager.createKey( new File( fr.getFontSource() ) );
      final FontDataInputSource fs =
        new ResourceFontDataInputSource( resourceManager, fontSource );
      final TrueTypeFont ttf = new TrueTypeFont( fs );
      final NameTable nt = (NameTable) ttf.getTable( NameTable.TABLE_ID );
      //PostscriptInformationTable pst = ttf.getTable(PostscriptInformationTable.TABLE_ID);
      final FontHeaderTable fht = (FontHeaderTable) ttf.getTable( FontHeaderTable.TABLE_ID );
      /*
      TrueTypeFontMetricsFactory tfmf = new TrueTypeFontMetricsFactory();
      FontMetrics fm =
              tfmf.createMetrics(fr, new DefaultFontContext(14, false, false));
      */
      System.out.println( "HERE!" );

    }
    if ( fofam == null ) {
      System.out.println( "Warning: Font not known " + name );
    } else {
      System.out.println( "Font registered " + name );
    }
  }
}
 
Example 13
Source File: WriteableDocumentBundleUtilsTest.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected void setUp() throws Exception {
  super.setUp();
  resourceManager = new ResourceManager();
  resourceManager.registerDefaults();
  tempFile = File.createTempFile( "junit", "tmp" );
  tempFile.deleteOnExit();
  tempKey = resourceManager.createKey( tempFile );
}
 
Example 14
Source File: KettleTransFromFileProducer.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
private ResourceKey createKey( final ResourceManager resourceManager,
                               final ResourceKey contextKey ) throws ResourceKeyCreationException {
  try {
    return resourceManager.deriveKey( contextKey, transformationFile );
  } catch ( ResourceKeyCreationException e ) {
    // failure is expected ..
  }

  return resourceManager.createKey( new File( transformationFile ) );
}
 
Example 15
Source File: ReportGenerator.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Parses the report from a given SAX-InputSource.
 *
 * @param input
 *          the report definition location.
 * @param contentBase
 *          the report's context (used to load content that has been referenced with relative URLs).
 * @return the parsed report.
 * @throws ResourceException
 *           if parsing or loading failed for some reason.
 * @throws IOException
 *           if an IO-related error occurs.
 */
public MasterReport parseReport( final InputSource input, final URL contentBase ) throws IOException,
  ResourceException {
  if ( input.getCharacterStream() != null ) {
    // Sourceforge Bug #1712734. We cannot safely route the character-stream through libloader.
    // Therefore we skip libloader and parse the report directly. This is for backward compatibility,
    // all other xml-based objects will still rely on LibLoader.

    return parseReportDirectly( input, contentBase );
  }

  final byte[] bytes = extractData( input );
  final ResourceManager resourceManager = new ResourceManager();
  final ResourceKey contextKey;
  if ( contentBase != null ) {
    contextKey = resourceManager.createKey( contentBase );
  } else {
    contextKey = null;
  }
  final HashMap map = new HashMap();

  final Iterator it = this.helperObjects.keySet().iterator();
  while ( it.hasNext() ) {
    final String name = (String) it.next();
    map.put( new FactoryParameterKey( name ), helperObjects.get( name ) );
  }

  final ResourceKey key = resourceManager.createKey( bytes, map );
  final Resource resource = resourceManager.create( key, contextKey, MasterReport.class );
  return (MasterReport) resource.getResource();
}
 
Example 16
Source File: URLResourceLoaderTest.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * Tests the serialization of File based resource keys
 */
public void testSerialize() throws Exception {
  final URLResourceLoader resourceLoader = new URLResourceLoader();
  final ResourceManager manager = new ResourceManager();
  manager.registerDefaults();
  ResourceKey key = null;
  Map<ParameterKey, Object> factoryParameters = new LinkedHashMap<ParameterKey, Object>();
  String serializedVersion = null;

  // Test with null parameter
  try {
    serializedVersion = resourceLoader.serialize( null, key );
    fail( "Serialization with a null paramter should throw a NullPointerException" ); //$NON-NLS-1$
  } catch ( NullPointerException npe ) {
    // success
  }

  // 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 ) {
    // 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$
    .startsWith( STRING_SERIALIZATION_PREFIX + resourceLoader.getClass().getName() + ';' ) );
  assertTrue( "Serialized version should contain the filename", serializedVersion.endsWith( URL1 ) ); //$NON-NLS-1$

  // Create a key as a relative path from the above key
  key = manager.deriveKey( key, "images/pentaho_logo.png" );
  assertNotNull( key );
  serializedVersion = resourceLoader.serialize( key, key );
  assertNotNull( serializedVersion );
  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$
    .startsWith( STRING_SERIALIZATION_PREFIX + resourceLoader.getClass().getName() + ';' ) );
  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 );
}
 
Example 17
Source File: AbstractFontFileRegistry.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
protected void loadFromCache( final String encoding, final String filename ) {
  final ResourceManager resourceManager = new ResourceManager();
  final File location = createStorageLocation();
  if ( location == null ) {
    return;
  }
  final File ttfCache = new File( location, filename );
  try {
    final ResourceKey resourceKey = resourceManager.createKey( ttfCache );
    final ResourceData data = resourceManager.load( resourceKey );
    final InputStream stream = data.getResourceAsStream( resourceManager );

    final HashMap<String, FontFileRecord> cachedSeenFiles;
    final HashMap<String, DefaultFontFamily> cachedFontFamilies;
    final HashMap<String, DefaultFontFamily> cachedFullFontNames;
    final HashMap<String, DefaultFontFamily> cachedAlternateNames;

    try {
      final ObjectInputStream oin = new ObjectInputStream( stream );
      final Object[] cache = (Object[]) oin.readObject();
      if ( cache.length != 5 ) {
        return;
      }
      if ( ObjectUtilities.equal( encoding, cache[ 0 ] ) == false ) {
        return;
      }
      cachedSeenFiles = (HashMap<String, FontFileRecord>) cache[ 1 ];
      cachedFontFamilies = (HashMap<String, DefaultFontFamily>) cache[ 2 ];
      cachedFullFontNames = (HashMap<String, DefaultFontFamily>) cache[ 3 ];
      cachedAlternateNames = (HashMap<String, DefaultFontFamily>) cache[ 4 ];
    } finally {
      stream.close();
    }

    // next; check the font-cache for validity. We cannot cleanly remove
    // entries from the cache once they become invalid, so we have to rebuild
    // the cache from scratch, if it is invalid.
    //
    // This should not matter that much, as font installations do not happen
    // every day.
    if ( isCacheValid( cachedSeenFiles ) ) {
      this.getSeenFiles().putAll( cachedSeenFiles );
      populateFromCache( cachedFontFamilies, cachedFullFontNames, cachedAlternateNames );
    }
  } catch ( final ClassNotFoundException cnfe ) {
    // ignore the exception.
    logger.debug( "Failed to restore the cache: Cache was created by a different version of LibFonts" );
  } catch ( Exception e ) {
    logger.debug( "Non-Fatal: Failed to restore the cache. The cache will be rebuilt.", e );
  }
}
 
Example 18
Source File: Prd3319IT.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
private ResourceKey createImageKey() throws IOException, ResourceKeyCreationException {
  final ResourceManager resMgr = new ResourceManager();
  resMgr.registerDefaults();
  return resMgr.createKey( new URL( "http://127.0.0.1:65535/image.jpg" ) );
}
 
Example 19
Source File: FileObjectResourceLoaderTest.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * Tests the serialization of FileObject based resource keys
 */
@Test
public void testSerializer() throws Exception {
  final FileObjectResourceLoader fileObjectResourceLoader = new FileObjectResourceLoader();
  final ResourceManager manager = new ResourceManager();
  manager.registerDefaults();

  ResourceKey key = null;
  Map<ParameterKey, Object> factoryParameters = new HashMap<ParameterKey, Object>();
  String serializedVersion;

  // Test with null parameter
  try {
    fileObjectResourceLoader.serialize( null, key );
    fail( "Serialization with a null parameter should throw a NullPointerException" ); //$NON-NLS-1$
  } catch ( NullPointerException npe ) {
    // success
  }

  // Test with a resource key instead of a fileObject key
  try {
    key = manager.createKey( "res://org/pentaho/reporting/libraries/resourceloader/SVG.svg" ); //$NON-NLS-1$
    fileObjectResourceLoader.serialize( key, key );
    fail( "The resource key should not be handled by the file object resource loader" ); //$NON-NLS-1$
  } catch ( IllegalArgumentException iae ) {
    // success
  }

  // Create a key from a fileObject
  final FileObject fileObject =
          VFS.getManager().resolveFile(
                  Paths.get( "src/test/resources/org/pentaho/reporting/libraries/resourceloader/SVG.svg" ).toAbsolutePath().toString() );

  key = manager.createKey( fileObject );
  serializedVersion = fileObjectResourceLoader.serialize( key, key );
  assertNotNull( "The returned key should not be null", key ); //$NON-NLS-1$
  assertTrue( "Serialized version 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$
          .startsWith( STRING_SERIALIZATION_PREFIX + fileObjectResourceLoader.getClass().getName() + ';' ) );
  assertTrue( "Serialized version should contain the filename",
          serializedVersion.endsWith( fileObject.getName().getBaseName() ) ); //$NON-NLS-1$
}