@@ -0,0 +1,2010 @@
+/**%0A * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies%0A * %0A * Please see distribution for license.%0A */%0Apackage com.opengamma.language.view;%0A%0Aimport static org.testng.Assert.assertEquals;%0A%0Aimport org.testng.annotations.Test;%0A%0Aimport com.opengamma.engine.value.ValueProperties;%0Aimport com.opengamma.util.tuple.Triple;%0A%0A@Test%0Apublic class ValueRequirementUtilsTest %7B%0A%0A  public void testParseRequirements() %7B%0A    assertEquals(Triple.of(%22Default%22, %22FairValue%22, ValueProperties.none()), ValueRequirementUtils.parseRequirement(%22FairValue%22));%0A    assertEquals(Triple.of(%22Default%22, %22Present Value%22, ValueProperties.none()), ValueRequirementUtils.parseRequirement(%22Present Value%22));%0A    assertEquals(Triple.of(%22Default%22, %22FairValue%22, ValueProperties.none()), ValueRequirementUtils.parseRequirement(%22Default/FairValue%22));%0A    assertEquals(Triple.of(%22Default%22, %22Present Value%22, ValueProperties.none()), ValueRequirementUtils.parseRequirement(%22Default/Present Value%22));%0A    assertEquals(Triple.of(%22Foo%22, %22FairValue%22, ValueProperties.none()), ValueRequirementUtils.parseRequirement(%22Foo/FairValue%22));%0A    assertEquals(Triple.of(%22SHIFT 10BPS%22, %22Present Value%22, ValueProperties.none()), ValueRequirementUtils.parseRequirement(%22SHIFT 10BPS/Present Value%22));%0A    assertEquals(Triple.of(%22Default%22, %22FairValue%22, ValueProperties.with(%22x%22, %22A%22).with(%22y%22, %22B%22).get()), ValueRequirementUtils.parseRequirement(%22FairValue%5Bx=A,y=B%5D%22));%0A    assertEquals(Triple.of(%22Default%22, %22Present Value%22, ValueProperties.with(%22x%22, %22A%22).with(%22y%22, %22B%22).get()), ValueRequirementUtils.parseRequirement(%22Present Value%7Bx=A,y=B%7D%22));%0A    assertEquals(Triple.of(%22Foo Bar%22, %22Present Value%22, ValueProperties.with(%22x%22, %22=%5B%5C%5C,%7B%7D%5D%22).get()), ValueRequirementUtils.parseRequirement(%22Foo Bar/Present Value%5Bx=%5C%5C=%5C%5C%5B%5C%5C%5C%5C%5C%5C,%7B%7D%5C%5C%5D%5D%22));%0A    assertEquals(Triple.of(%22Foo Bar%22, %22Present Value%22, ValueProperties.with(%22x%22, %22=%5B%5C%5C,%7B%7D%5D %22).get()), ValueRequirementUtils.parseRequirement(%22Foo Bar/Present Value%5Bx=%5C%5C=%5C%5C%5B%5C%5C%5C%5C%5C%5C,%7B%7D%5C%5C%5D%5C%5C %5D%22));%0A  %7D%0A%0A%7D%0A

Test correct/expected parsing of value requirement strings.