コード例 #1
0
 private EmbeddedConfiguration aliasConfig() {
   EmbeddedConfiguration configuration = Db4oEmbedded.newConfiguration();
   configuration
       .common()
       .addAlias(
           new TypeAlias(
               CrossPlatformServices.fullyQualifiedName(A.class),
               CrossPlatformServices.fullyQualifiedName(B.class)));
   return configuration;
 }
コード例 #2
0
  public void testNameIsAvailableAtConfigurationItemApplication() {
    EmbeddedConfiguration config = config();
    config.common().nameProvider(new CustomNameProvider());
    config
        .common()
        .add(
            new ConfigurationItem() {

              public void apply(InternalObjectContainer container) {
                Assert.areEqual(CUSTOM_NAME, container.toString());
              }

              public void prepare(Configuration configuration) {}
            });
    assertName(config, CUSTOM_NAME);
  }
コード例 #3
0
 private EmbeddedConfiguration config() {
   EmbeddedConfiguration config = Db4oEmbedded.newConfiguration();
   config.file().storage(new MemoryStorage());
   return config;
 }
コード例 #4
0
 public void testCustom() {
   EmbeddedConfiguration config = config();
   config.common().nameProvider(new CustomNameProvider());
   assertName(config, CUSTOM_NAME);
 }