Package com.opengamma.engine.marketdata.manipulator

Examples of com.opengamma.engine.marketdata.manipulator.ScenarioParameters


      UniqueId scenarioParametersId = calcConfig.getScenarioParametersId();
      if (scenarioId != null) {
        ScenarioDefinitionFactory scenarioDefinitionFactory = configSource.getConfig(ScenarioDefinitionFactory.class, scenarioId);
        Map<String, Object> parameters;
        if (scenarioParametersId != null) {
          ScenarioParameters scenarioParameters = configSource.getConfig(ScenarioParameters.class, scenarioParametersId);
          parameters = scenarioParameters.getParameters();
        } else {
          parameters = null;
        }
        ScenarioDefinition scenarioDefinition = scenarioDefinitionFactory.create(parameters);
        specificSelectors.put(calcConfig.getName(), new HashMap<>(scenarioDefinition.getDefinitionMap()));
View Full Code Here


  @Test
  public void setParametersFromScript() throws IOException {
    String scriptFile = "src/test/groovy/ScenarioParametersTest.groovy";
    String script = IOUtils.toString(new BufferedReader(new FileReader(scriptFile)));
    ScenarioParameters scenarioParameters = new ScenarioDslParameters(script);
    Map<String,Object> parameters = scenarioParameters.getParameters();
    assertEquals("foo", parameters.get("aString"));
    assertEquals(Lists.newArrayList(1, 2, 3), parameters.get("aList"));
    assertEquals(1.234, ((Number) parameters.get("aDouble")).doubleValue());
    assertEquals(ImmutableMap.of("key1", "value1", "key2", "value2"), parameters.get("aMap"));
    assertEquals(LocalDate.of(2011, 3, 8), parameters.get("aLocalDate"));
View Full Code Here

TOP

Related Classes of com.opengamma.engine.marketdata.manipulator.ScenarioParameters

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.