Package com.opengamma.engine.calcnode

Examples of com.opengamma.engine.calcnode.MutableExecutionLog


@Test(groups = TestGroup.UNIT)
public class ExecutionLogFudgeBuilderTest {

  @Test
  public void roundTrip() {
    MutableExecutionLog log = new MutableExecutionLog(ExecutionLogMode.FULL);
    LogEvent errorEvent = new SimpleLogEvent(LogLevel.ERROR, "error msg");
    LogEvent infoEvent1 = new SimpleLogEvent(LogLevel.INFO, "info msg");
    LogEvent infoEvent2 = new SimpleLogEvent(LogLevel.INFO, "info msg2");
    log.add(errorEvent);
    log.add(infoEvent1);
    log.add(infoEvent2);
    String execptionMsg = "exception msg";
    assertEquals(log.getLogLevels(), EnumSet.of(LogLevel.ERROR, LogLevel.INFO));
    log.setException(new OpenGammaRuntimeException(execptionMsg));
    assertEquals(log.getLogLevels(), EnumSet.of(LogLevel.ERROR, LogLevel.INFO, LogLevel.WARN));
    FudgeSerializer serializer = new FudgeSerializer(OpenGammaFudgeContext.getInstance());
    ExecutionLogFudgeBuilder builder = new ExecutionLogFudgeBuilder();
    FudgeMsg msg = builder.buildMessage(serializer, log);

    FudgeDeserializer deserializer = new FudgeDeserializer(OpenGammaFudgeContext.getInstance());
View Full Code Here


      // Process the streamed result fragment
      final ExecutionLogMode executionLogMode = logModes.getLogMode(node);
      final AggregatedExecutionLog aggregatedExecutionLog;
      if (executionLogMode == ExecutionLogMode.FULL) {
        final ExecutionLog log = jobResultItem.getExecutionLog();
        MutableExecutionLog logCopy = null;
        final Set<AggregatedExecutionLog> inputLogs = new LinkedHashSet<AggregatedExecutionLog>();
        Set<ValueSpecification> missing = jobResultItem.getMissingInputs();
        if (!missing.isEmpty()) {
          if (logCopy == null) {
            logCopy = new MutableExecutionLog(log);
          }
          logCopy.add(new SimpleLogEvent(log.hasException() ? LogLevel.WARN : LogLevel.INFO, toString("Missing input", missing)));
        }
        missing = jobResultItem.getMissingOutputs();
        if (!missing.isEmpty()) {
          if (logCopy == null) {
            logCopy = new MutableExecutionLog(log);
          }
          logCopy.add(new SimpleLogEvent(LogLevel.WARN, toString("Failed to produce output", missing)));
        }
        for (final ValueSpecification inputValueSpec : node.getInputValues()) {
          final DependencyNodeJobExecutionResult nodeResult = jobExecutionResultCache.get(inputValueSpec);
          if (nodeResult == null) {
            // Market data
View Full Code Here

    IdentifierMap identifierMap = new InMemoryIdentifierMap ();
    CalculationJobSpecification spec = new CalculationJobSpecification(UniqueId.of("Test", "ViewCycle"), "config", Instant.now(), 1L);
   
    CalculationJobResultItem item1 = CalculationJobResultItem.success();
   
    MutableExecutionLog executionLog = new MutableExecutionLog(ExecutionLogMode.INDICATORS);
    CalculationJobResultItem item2 = CalculationJobResultItemBuilder.of(executionLog).withException(new RuntimeException("failure!")).toResultItem();
   
    CalculationJobResult result = new CalculationJobResult(spec,
        500,
        Lists.newArrayList(item1, item2),
View Full Code Here

TOP

Related Classes of com.opengamma.engine.calcnode.MutableExecutionLog

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.