public virtual void test_of_All()
        {
            CalculationRules test = CalculationRules.of(FUNCTIONS, ReportingCurrency.of(USD), CalculationParameters.of(PARAM));

            assertEquals(test.Functions, FUNCTIONS);
            assertEquals(test.ReportingCurrency, ReportingCurrency.of(USD));
            assertEquals(test.Parameters, CalculationParameters.of(PARAM));
        }
        public virtual void test_of_FunctionsParametersObject()
        {
            CalculationRules test = CalculationRules.of(FUNCTIONS, CalculationParameters.of(PARAM));

            assertEquals(test.Functions, FUNCTIONS);
            assertEquals(test.ReportingCurrency, ReportingCurrency.NATURAL);
            assertEquals(test.Parameters, CalculationParameters.of(PARAM));
        }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            CalculationRules test = CalculationRules.of(FUNCTIONS);

            coverImmutableBean(test);
            CalculationRules test2 = CalculationRules.of(FUNCTIONS, USD);

            coverBeanEquals(test, test2);
        }
 //-----------------------------------------------------------------------
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         CalculationRules other = (CalculationRules)obj;
         return(JodaBeanUtils.equal(functions, other.functions) && JodaBeanUtils.equal(reportingCurrency, other.reportingCurrency) && JodaBeanUtils.equal(parameters, other.parameters));
     }
     return(false);
 }
        //-------------------------------------------------------------------------
        public virtual void calculate()
        {
            ImmutableList <CalculationTarget> targets = ImmutableList.of(TARGET);
            Column column1 = Column.of(TestingMeasures.PRESENT_VALUE);
            Column column2 = Column.of(TestingMeasures.BUCKETED_PV01);
            ImmutableList <Column> columns = ImmutableList.of(column1, column2);
            CalculationRules       rules   = CalculationRules.of(CalculationFunctions.empty());
            MarketData             md      = MarketData.empty(date(2016, 6, 30));
            ScenarioMarketData     smd     = ScenarioMarketData.empty();

            // use of try-with-resources checks class is AutoCloseable
            using (CalculationRunner test = CalculationRunner.of(MoreExecutors.newDirectExecutorService()))
            {
                assertThat(test.calculate(rules, targets, columns, md, REF_DATA).get(0, 0).Failure).True;
                assertThat(test.calculateMultiScenario(rules, targets, columns, smd, REF_DATA).get(0, 0).Failure).True;
            }
        }
Ejemplo n.º 6
0
        public virtual void calculateMultiScenarioAsync <T1>(CalculationRules calculationRules, IList <T1> targets, IList <Column> columns, ScenarioMarketData marketData, ReferenceData refData, CalculationListener listener) where T1 : com.opengamma.strata.basics.CalculationTarget
        {
            CalculationTasks tasks = CalculationTasks.of(calculationRules, targets, columns, refData);

            taskRunner.calculateMultiScenarioAsync(tasks, marketData, refData, listener);
        }
Ejemplo n.º 7
0
        //-------------------------------------------------------------------------
        public virtual Results calculateMultiScenario <T1>(CalculationRules calculationRules, IList <T1> targets, IList <Column> columns, ScenarioMarketData marketData, ReferenceData refData) where T1 : com.opengamma.strata.basics.CalculationTarget
        {
            CalculationTasks tasks = CalculationTasks.of(calculationRules, targets, columns, refData);

            return(taskRunner.calculateMultiScenario(tasks, marketData, refData));
        }