コード例 #1
0
        public virtual void test_resolve_createNotionalExchange_finalOnly()
        {
            RatePeriodSwapLeg test     = RatePeriodSwapLeg.builder().type(IBOR).payReceive(RECEIVE).paymentPeriods(RPP1).initialExchange(false).intermediateExchange(false).finalExchange(true).build();
            ResolvedSwapLeg   expected = ResolvedSwapLeg.builder().type(IBOR).payReceive(RECEIVE).paymentPeriods(RPP1).paymentEvents(NotionalExchange.of(CurrencyAmount.of(GBP, 5000d), DATE_2014_10_01)).build();

            assertEquals(test.resolve(REF_DATA), expected);
        }
コード例 #2
0
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            RatePeriodSwapLeg test     = RatePeriodSwapLeg.builder().type(IBOR).payReceive(RECEIVE).paymentPeriods(RPP1).paymentEvents(NOTIONAL_EXCHANGE).build();
            ResolvedSwapLeg   expected = ResolvedSwapLeg.builder().type(IBOR).payReceive(RECEIVE).paymentPeriods(RPP1).paymentEvents(NOTIONAL_EXCHANGE).build();

            assertEquals(test.resolve(REF_DATA), expected);
        }
コード例 #3
0
        public virtual void test_resolve_FxResetOmitInitialNotionalExchange()
        {
            RatePeriodSwapLeg test = RatePeriodSwapLeg.builder().type(IBOR).payReceive(PAY).paymentPeriods(RPP1_FXRESET).initialExchange(false).intermediateExchange(true).finalExchange(true).build();

            FxResetNotionalExchange finalExchange = FxResetNotionalExchange.of(CurrencyAmount.of(USD, 8000d), DATE_2014_10_01, FxIndexObservation.of(GBP_USD_WM, DATE_2014_06_28, REF_DATA));

            ResolvedSwapLeg expected = ResolvedSwapLeg.builder().type(IBOR).payReceive(PAY).paymentPeriods(RPP1_FXRESET).paymentEvents(finalExchange).build();

            assertEquals(test.resolve(REF_DATA), expected);
        }
コード例 #4
0
        public virtual void test_resolve_fxResetNotionalExchange()
        {
            RatePeriodSwapLeg       test     = RatePeriodSwapLeg.builder().type(IBOR).payReceive(RECEIVE).paymentPeriods(RPP1_FXRESET, RPP2).initialExchange(true).intermediateExchange(true).finalExchange(true).build();
            FxResetNotionalExchange ne1a     = FxResetNotionalExchange.of(CurrencyAmount.of(USD, -8000d), DATE_2014_06_30, FxIndexObservation.of(GBP_USD_WM, DATE_2014_06_28, REF_DATA));
            FxResetNotionalExchange ne1b     = FxResetNotionalExchange.of(CurrencyAmount.of(USD, 8000d), DATE_2014_10_01, FxIndexObservation.of(GBP_USD_WM, DATE_2014_06_28, REF_DATA));
            NotionalExchange        ne2a     = NotionalExchange.of(CurrencyAmount.of(GBP, -6000d), DATE_2014_10_01);
            NotionalExchange        ne2b     = NotionalExchange.of(CurrencyAmount.of(GBP, 6000d), DATE_2014_01_02);
            ResolvedSwapLeg         expected = ResolvedSwapLeg.builder().type(IBOR).payReceive(RECEIVE).paymentPeriods(RPP1_FXRESET, RPP2).paymentEvents(ne1a, ne1b, ne2a, ne2b).build();

            assertEquals(test.resolve(REF_DATA), expected);
        }