Package com.opengamma.master.config

Examples of com.opengamma.master.config.ConfigDocument$Meta


  public void setUp() {
    _testEmpty = new InMemoryConfigMaster(new ObjectIdSupplier("Test"));
    _testPopulated = new InMemoryConfigMaster(new ObjectIdSupplier("Test"));
    _item1 = ConfigItem.of(VAL1);
    _item1.setName("ONE");
    _item1 = (ConfigItem<ExternalId>) _testPopulated.add(new ConfigDocument(_item1)).getConfig();
    _item2 = ConfigItem.of(VAL2);
    _item2.setName("TWO");
    _item2 = (ConfigItem<ExternalId>) _testPopulated.add(new ConfigDocument(_item2)).getConfig();
    _item3 = ConfigItem.of(VAL3);
    _item3.setName("THREE");
    _item3 = (ConfigItem<ExternalIdBundle>) _testPopulated.add(new ConfigDocument(_item3)).getConfig();
    _item4 = ConfigItem.of(VAL4);
    _item4.setName("FOUR");
    _item4 = (ConfigItem<ExternalIdBundle>) _testPopulated.add(new ConfigDocument(_item4)).getConfig();
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  public void test_defaultSupplier() {
    InMemoryConfigMaster master = new InMemoryConfigMaster();
    ConfigItem<ExternalId> item = ConfigItem.of(VAL1);
    item.setName("ONE");
    ConfigItem<ExternalId> added = (ConfigItem<ExternalId>) master.add(new ConfigDocument(item)).getConfig();
    assertEquals("MemCfg", added.getUniqueId().getScheme());
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public void test_alternateSupplier() {
    InMemoryConfigMaster master = new InMemoryConfigMaster(new ObjectIdSupplier("Hello"));
    ConfigItem<ExternalId> item = ConfigItem.of(VAL1);
    item.setName("ONE");
    ConfigItem<ExternalId> added = (ConfigItem<ExternalId>) master.add(new ConfigDocument(item)).getConfig();
    assertEquals("Hello", added.getUniqueId().getScheme());
  }
View Full Code Here

  //-------------------------------------------------------------------------
  public void test_add_emptyMaster() {
    ConfigItem<ExternalId> item = ConfigItem.of(VAL1);
    item.setName("Test");
    ConfigDocument doc = _testEmpty.add(new ConfigDocument(item));
    assertNotNull(doc.getVersionFromInstant());
    assertEquals("Test", doc.getUniqueId().getScheme());
    assertSame(VAL1, doc.getConfig().getValue());
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Test(expectedExceptions = DataNotFoundException.class)
  public void test_update_emptyMaster() {
    ConfigItem<ExternalId> item = ConfigItem.of(VAL1);
    item.setUniqueId(OTHER_UID);
    _testEmpty.update(new ConfigDocument(item));
  }
View Full Code Here

  }

  public void test_update_populatedMaster() {
    ConfigItem<ExternalId> item = ConfigItem.of(VAL1);
    item.setUniqueId(_item1.getUniqueId());
    ConfigDocument updated = _testPopulated.update(new ConfigDocument(item));
    assertTrue(_item1.getUniqueId().getScheme().equals(updated.getUniqueId().getScheme()));
    assertTrue(_item1.getUniqueId().getValue().equals(updated.getUniqueId().getValue()));
    assertFalse(_item1.getUniqueId().getVersion().equals(updated.getUniqueId().getVersion()));
    assertNotNull(updated.getVersionFromInstant());
    assertNotNull(updated.getVersionFromInstant());
  }
View Full Code Here

  private MasterConfigSource _configSource;

  @BeforeMethod
  public void setUp() throws Exception {
    InMemoryConfigMaster configMaster = new InMemoryConfigMaster();
    ConfigDocument added = configMaster.add(new ConfigDocument(ITEM));
    ITEM.setUniqueId(added.getUniqueId());
    _configSource = new MasterConfigSource(configMaster);
  }
View Full Code Here

        calcConfig.addPortfolioRequirement(securityType, requirementName, ValueProperties.none());
      }
    }
    viewDefinition.addViewCalculationConfiguration(calcConfig);
    final ConfigItem<ViewDefinition> configItem = ConfigItem.of(viewDefinition, viewDefinition.getName());
    final ConfigDocument configDoc = getUserConfigMaster().add(new ConfigDocument(configItem));
    return configDoc.getUniqueId();
  }
View Full Code Here

   */
  public void run() {
    final ConfigItem<HistoricalTimeSeriesRating> configItem = ConfigItem.of(DEFAULT_CONFIG, DEFAULT_CONFIG_NAME);
    final ConfigSearchRequest<HistoricalTimeSeriesRating> req = new ConfigSearchRequest<HistoricalTimeSeriesRating>();
    req.setName(configItem.getName());
    final ConfigDocument configDocument = new ConfigDocument(configItem);
    final ConfigSearchResult<HistoricalTimeSeriesRating> res = getConfigMaster().search(req);
    if (res.getDocuments().isEmpty()) {
      getConfigMaster().add(configDocument);
    } else {
      configDocument.setUniqueId(res.getDocuments().get(0).getUniqueId());
      getConfigMaster().update(configDocument);
    }
  }
View Full Code Here

    EHCacheUtils.clear(_cacheManager, EHCachingMasterConfigSource.CONFIG_CACHE);
  }

  //-------------------------------------------------------------------------
  public void getConfig_uniqueId() {
    final UniqueId uniqueId = _underlyingConfigMaster.add(new ConfigDocument(ITEM)).getUniqueId();
    assertSame(_cachingSource.getConfig(ExternalId.class, uniqueId), CONFIG);
    assertSame(_cachingSource.getConfig(ExternalId.class, uniqueId), CONFIG);
    assertEquals(1, _underlyingConfigMaster.getCounter().get());
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.config.ConfigDocument$Meta

Copyright © 2018 www.massapicom. 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.