Code example for Properties

Methods: setProperty, store

0
    LibDocBundleBoot.getInstance().start(); 
  } 
 
  public void testBug() throws IOException, ResourceException, InterruptedException 
  { 
    final Properties p1 = new Properties();
    p1.setProperty("key", "value1");
 
    final MemoryDocumentBundle bundle = new MemoryDocumentBundle();
    bundle.getWriteableDocumentMetaData().setBundleType("text/plain");
    final OutputStream outputStream = bundle.createEntry("test.properties", "text/plain");
    p1.store(outputStream, "run 1");
    outputStream.close();
 
    final ResourceManager resourceManager = bundle.getResourceManager();
    final ResourceKey key = resourceManager.deriveKey(bundle.getBundleMainKey(), "test.properties");
    final Resource res1 = resourceManager.create(key, null, Properties.class);
    assertEquals(p1, res1.getResource());
 
    bundle.removeEntry("test.properties");
 
    final Properties p2 = new Properties();
    p2.setProperty("key", "value2");