Package com.opengamma.engine.function.resolver

Examples of com.opengamma.engine.function.resolver.SimpleResolutionRuleTransform$Action


    calcConfig1.setScenarioId(UniqueId.of("ScenarioDefinition", "sd1"));

    final ViewCalculationConfiguration calcConfig2 = new ViewCalculationConfiguration(viewDefinition, "2");
    calcConfig2.addSpecificRequirement(new ValueRequirement("Value2", ComputationTargetType.PRIMITIVE, UniqueId.of("Test", "Foo")));
    calcConfig2.addSpecificRequirement(new ValueRequirement("Value2", ComputationTargetType.PRIMITIVE, UniqueId.of("Test", "Bar")));
    final SimpleResolutionRuleTransform transform = new SimpleResolutionRuleTransform();
    transform.suppressRule("Foo");
    calcConfig2.setResolutionRuleTransform(transform);

    viewDefinition.setDefaultCurrency(Currency.USD);
    viewDefinition.addViewCalculationConfiguration(calcConfig1);
    viewDefinition.addViewCalculationConfiguration(calcConfig2);
View Full Code Here


    return message;
  }

  @Override
  public SimpleResolutionRuleTransform buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
    final SimpleResolutionRuleTransform transform = new SimpleResolutionRuleTransform();
    for (FudgeField field : message) {
      if (field.getName() != null) {
        if (field.getValue() == IndicatorType.INSTANCE) {
          transform.suppressRule(field.getName());
        } else if (field.getValue() instanceof FudgeMsg) {
          final FudgeMsg action = (FudgeMsg) field.getValue();
          final FudgeField parameters = action.getByName(PARAMETERS_FIELD);
          final FudgeField filter = action.getByName(FILTER_FIELD);
          final FudgeField priority = action.getByName(PRIORITY_FIELD);
          transform.adjustRule(field.getName(), (parameters != null) ? deserializer.fieldValueToObject(FunctionParameters.class, parameters) : null, (filter != null) ? deserializer.fieldValueToObject(
              ComputationTargetFilter.class, filter) : null, (priority != null) ? message.getFieldValue(Integer.class, priority) : null);
        }
      }
    }
    return transform;
View Full Code Here

*/
@Test(groups = TestGroup.UNIT)
public class SimpleResolutionRuleTransformBuilderTest extends AbstractFudgeBuilderTestCase {

  public void testEmpty() {
    final SimpleResolutionRuleTransform transform = new SimpleResolutionRuleTransform();
    assertEncodeDecodeCycle(ResolutionRuleTransform.class, transform);
  }
View Full Code Here

    final SimpleResolutionRuleTransform transform = new SimpleResolutionRuleTransform();
    assertEncodeDecodeCycle(ResolutionRuleTransform.class, transform);
  }

  public void testPopulated () {
    final SimpleResolutionRuleTransform transform = new SimpleResolutionRuleTransform ();
    transform.suppressRule("Foo");
    transform.adjustRule("Bar", new EmptyFunctionParameters(), null, null);
    transform.adjustRule("Bar", null, ApplyToAllTargets.INSTANCE, null);
    transform.adjustRule("Bar", null, null, 42);
    transform.adjustRule("Cow", new EmptyFunctionParameters(), ApplyToAllTargets.INSTANCE, -42);
    assertEncodeDecodeCycle(ResolutionRuleTransform.class, transform);
  }
View Full Code Here

    Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put(sb.toString(), "");
    parameters.put("huuhaa", "");

    Action action = new SimpleAction();
    parametersInterceptor.setParameters(action, stack, parameters);
    assertEquals(1, actual.size());
  }
View Full Code Here

    public void testNoParametersAction() throws Exception {
        ParametersInterceptor interceptor = new ParametersInterceptor();
        interceptor.init();

        MockActionInvocation mai = new MockActionInvocation();
        Action action = new NoParametersAction();
        mai.setAction(action);

        interceptor.doIntercept(mai);
        interceptor.destroy();
    }
View Full Code Here

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("user.address.city", "London");
        parameters.put("user.name", "Superman");

        Action action = new SimpleAction();
        pi.setParameters(action, stack, parameters);

        assertEquals("ordered should be false by default", false, pi.isOrdered());
        assertEquals(2, actual.size());
        assertEquals("London", actual.get("user.address.city"));
View Full Code Here

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("user.address.city", "London");
        parameters.put("user.address['postal']", "QJR387");
        parameters.put("user.name", "Superman");

        Action action = new SimpleAction();
        pi.setParameters(action, stack, parameters);

        assertEquals(true, pi.isOrdered());
        assertEquals(3, actual.size());
        assertEquals("London", actual.get("user.address.city"));
View Full Code Here

        sac.registerSingleton("proxyFactory", BeanNameAutoProxyCreator.class, values);

        sac.refresh();

        ActionConfig actionConfig = new ActionConfig.Builder("", "", SimpleAction.class.getName()).build();
        Action action = (Action) objectFactory.buildBean(actionConfig.getClassName(), null);

        assertNotNull("Bean should not be null", action);
        System.out.println("Action class is: " + action.getClass().getName());
        assertTrue("Action should have been advised", action instanceof Advised);
    }
View Full Code Here

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put(sb.toString(), "");
        parameters.put("huuhaa", "");

        Action action = new SimpleAction();
        parametersInterceptor.setParameters(action, stack, parameters);
        assertEquals(1, actual.size());
    }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.function.resolver.SimpleResolutionRuleTransform$Action

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.