Examples of toOffsetTime()


Examples of org.threeten.bp.OffsetDateTime.toOffsetTime()

    final OffsetDateTime now = OffsetDateTime.now();
    final InMemorySecuritySource secSource = new InMemorySecuritySource();
    final MockPositionSource posSource = new MockPositionSource();
    final SimplePortfolio portfolio = new SimplePortfolio(UniqueId.of("Test", "1"), "Name");
    final SimplePosition position = new SimplePosition(UniqueId.of("Test", "1"), new BigDecimal(1), ExternalIdBundle.EMPTY);
    final SimpleTrade trade = new SimpleTrade(new SimpleSecurityLink(), new BigDecimal(1), new SimpleCounterparty(ExternalId.of("CPARTY", "C100")), now.toLocalDate(), now.toOffsetTime());
    trade.setUniqueId(UniqueId.of("TradeScheme", "1"));
    position.addTrade(trade);
    portfolio.getRootNode().addPosition(position);
    posSource.addPortfolio(portfolio);
    final DefaultComputationTargetResolver test = new DefaultComputationTargetResolver(secSource, posSource);
View Full Code Here

Examples of org.threeten.bp.OffsetDateTime.toOffsetTime()

          // Assume we got triggered early.
          atTheHour = atTheHour.withMinute(0).plusHours(1);
        } else {
          atTheHour = atTheHour.withMinute(0);
        }
        String observationTimeName = atTheHour.toOffsetTime().toString();
        try {
          _storageExecutor.execute(new StorageTask(entry.getKey(), entry.getValue(), atTheHour.toLocalDate(), observationTimeName));
        } catch (Exception e) {
          s_logger.error("Unable to submit a storage task to store {} {}", entry.getKey(), entry.getValue());
        }
View Full Code Here

Examples of org.threeten.bp.OffsetDateTime.toOffsetTime()

  public void test_getTrade() throws Exception {
    final PortfolioMaster mockPortfolio = mock(PortfolioMaster.class);
    final PositionMaster mockPosition = mock(PositionMaster.class);
    final OffsetDateTime now = OffsetDateTime.now();
    final ManageableTrade doc = new ManageableTrade(BigDecimal.TEN, ExternalId.of("B", "C"), now.toLocalDate(), now.toOffsetTime().minusSeconds(100), ExternalId.of("CPARTY", "C100"));
    doc.setUniqueId(UID);
    when(mockPosition.getTrade(UID)).thenReturn(doc);
    MasterPositionSource test = new MasterPositionSource(mockPortfolio, mockPosition);
    Trade testResult = test.getTrade(UID);
    verify(mockPosition, times(1)).getTrade(UID);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.