@@ -0,0 +1,2751 @@
+/**%0A * Copyright (C) 2009 - 2010 by OpenGamma Inc.%0A *%0A * Please see distribution for license.%0A */%0A%0Apackage com.opengamma.engine.view;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNotNull;%0A%0Aimport java.math.BigDecimal;%0Aimport java.util.HashMap;%0Aimport java.util.Set;%0A%0Aimport org.junit.Test;%0A%0Aimport com.google.common.collect.Maps;%0Aimport com.google.common.collect.Sets;%0Aimport com.opengamma.engine.ComputationTargetSpecification;%0Aimport com.opengamma.engine.position.PortfolioImpl;%0Aimport com.opengamma.engine.position.PortfolioNodeImpl;%0Aimport com.opengamma.engine.position.Position;%0Aimport com.opengamma.engine.position.PositionImpl;%0Aimport com.opengamma.engine.value.ComputedValue;%0Aimport com.opengamma.engine.value.ValueRequirement;%0Aimport com.opengamma.engine.value.ValueSpecification;%0Aimport com.opengamma.id.IdentifierBundle;%0Aimport com.opengamma.id.UniqueIdentifier;%0A%0A/**%0A * %0A */%0Apublic class ViewComputationResultModelImplTest %7B%0A  %0A  private static final Position POSITION = new PositionImpl(UniqueIdentifier.of(%22PositionIdentifier%22, %22testPosition%22), new BigDecimal(1), new IdentifierBundle());%0A  private static final ComputationTargetSpecification SPEC = new ComputationTargetSpecification(POSITION);%0A  private static final ComputedValue COMPUTED_VALUE = new ComputedValue(new ValueSpecification(new ValueRequirement(%22DATA%22, SPEC)), %2212345%22);%0A  %0A  @Test%0A  public void test() %7B%0A    ViewComputationResultModelImpl model = new ViewComputationResultModelImpl();%0A    %0A    model.setInputDataTimestamp(400);%0A    assertEquals(400, model.getInputDataTimestamp());%0A    model.setResultTimestamp(500);%0A    assertEquals(500, model.getResultTimestamp());%0A    %0A    Set%3CString%3E calcConfigNames = Sets.newHashSet(%22configName1%22, %22configName2%22);%0A    model.setCalculationConfigurationNames(calcConfigNames);%0A    assertEquals(calcConfigNames, model.getCalculationConfigurationNames());%0A    %0A    PortfolioImpl portfolio = new PortfolioImpl(%22testportfolio%22);%0A    PortfolioNodeImpl rootNode = new PortfolioNodeImpl(UniqueIdentifier.of(%22PortfolioIdentifier%22, %22rootNode%22), %22rootNode%22);%0A    portfolio.setRootNode(rootNode);%0A    rootNode.addPosition(POSITION);%0A    %0A    model.setPortfolio(portfolio);%0A    model.addValue(%22configName1%22, COMPUTED_VALUE);%0A    %0A    assertEquals(Sets.newHashSet(SPEC, new ComputationTargetSpecification(rootNode)), Sets.newHashSet(model.getAllTargets()));%0A    %0A    ViewCalculationResultModel calcResult = model.getCalculationResult(%22configName1%22);%0A    assertNotNull(calcResult);%0A    %0A    HashMap%3CString, ComputedValue%3E expectedMap = new HashMap%3CString, ComputedValue%3E();%0A    expectedMap.put(%22DATA%22, COMPUTED_VALUE);%0A    assertEquals(expectedMap, Maps.newHashMap(calcResult.getValues(SPEC)));%0A    %0A  %7D%0A%0A%7D%0A

Write unit test of ViewComputationResultModelImpl