Package com.opengamma.engine.target.Primitive

Examples of com.opengamma.engine.target.Primitive.ExternalBundleIdentifiablePrimitive


  }

  public void testGetAvailability_externalIdBundle_nomatch() {
    final MarketDataAvailabilityFilter availability = create();
    final ComputationTargetSpecification targetSpec = new ComputationTargetSpecification(ComputationTargetType.SECURITY, UniqueId.of("Security", "Foo"));
    final Object target = new ExternalBundleIdentifiablePrimitive(UniqueId.of("Security", "Foo"), ExternalIdBundle.of(ExternalId.of("BAD1", "Foo"), ExternalId.of("BAD2", "Foo")));
    ValueRequirement desiredValue = new ValueRequirement("Cow", targetSpec);
    assertFalse(availability.isAvailable(targetSpec, target, desiredValue));
    desiredValue = new ValueRequirement("Foo", targetSpec);
    assertFalse(availability.isAvailable(targetSpec, target, desiredValue));
  }
View Full Code Here


  }

  public void testGetAvailability_externalIdBundle_match() {
    final MarketDataAvailabilityFilter availability = create();
    final ComputationTargetSpecification targetSpec = new ComputationTargetSpecification(ComputationTargetType.SECURITY, UniqueId.of("Security", "Foo"));
    final Object target = new ExternalBundleIdentifiablePrimitive(UniqueId.of("Security", "Foo"), ExternalIdBundle.of(ExternalId.of("Ticker", "X"), ExternalId.of("BAD2", "Foo"),
        ExternalId.of("Ticker", "Y")));
    ValueRequirement desiredValue = new ValueRequirement("Cow", targetSpec);
    assertFalse(availability.isAvailable(targetSpec, target, desiredValue));
    desiredValue = new ValueRequirement("Foo", targetSpec);
    assertTrue(availability.isAvailable(targetSpec, target, desiredValue));
View Full Code Here

  }

  public void testGetAvailability_externalIdBundle() {
    final MarketDataAvailabilityProvider availability = create();
    final ComputationTargetSpecification targetSpec = new ComputationTargetSpecification(ComputationTargetType.SECURITY, UniqueId.of("Security", "Foo"));
    final Object target = new ExternalBundleIdentifiablePrimitive(UniqueId.of("Security", "Foo"), ExternalIdBundle.of("Ticker", "Foo"));
    final ValueRequirement desiredValue = new ValueRequirement("Bar", targetSpec);
    assertEquals(availability.getAvailability(targetSpec, target, desiredValue).getProperty(ValuePropertyNames.FUNCTION), "externalIdBundle");
  }
View Full Code Here

      protected void populateAvailabilityHintKey(final Collection<Serializable> key) {
        // Don't care
      }

    };
    final Object target = new ExternalBundleIdentifiablePrimitive(targetSpec.getUniqueId(), identifiers);
    assertTrue(filter.isAvailable(targetSpec, target, desiredValue));
    final AbstractMarketDataAvailabilityProvider provider = Mockito.mock(AbstractMarketDataAvailabilityProvider.class);
    final ValueSpecification valueSpec = new ValueSpecification(desiredValue.getValueName(), targetSpec, ValueProperties.with(ValuePropertyNames.FUNCTION, "Mock").get());
    Mockito.when(provider.getAvailability(targetSpec, identifiers, desiredValue)).thenReturn(valueSpec);
    assertEquals(filter.withProvider(provider).getAvailability(targetSpec, target, desiredValue), valueSpec);
View Full Code Here

            } else {
              final ExternalId[] identifiers = new ExternalId[schemes.length];
              for (int i = 0; i < schemes.length; i++) {
                identifiers[i] = ExternalId.of(schemes[i], values[i]);
              }
              return new ExternalBundleIdentifiablePrimitive(uniqueId, ExternalIdBundle.of(identifiers));
            }
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.target.Primitive.ExternalBundleIdentifiablePrimitive

Copyright © 2018 www.massapicom. 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.