Examples of WatchedJob


Examples of com.opengamma.engine.calcnode.WatchedJob

    final JobDispatcher dispatcher = new JobDispatcher();
    final FunctionBlacklistMaintainer blacklist = Mockito.mock(FunctionBlacklistMaintainer.class);
    dispatcher.setFunctionBlacklistMaintainer(blacklist);
    final CalculationJob job = new CalculationJob(createJobSpecification(), 0, VersionCorrection.LATEST, null, Arrays.asList(JOB_ITEM_A), CacheSelectHint.allShared());
    final StandardJob standard = new StandardJob(dispatcher, job, Mockito.mock(JobResultReceiver.class));
    final WatchedJob watched = standard.createWatchedJob();
    assertNull(watched);
    Mockito.verify(blacklist).failedJobItem(JOB_ITEM_A);
  }
View Full Code Here

Examples of com.opengamma.engine.calcnode.WatchedJob

  public void testStandardJob_createWatchedJob_noTail() {
    final JobDispatcher dispatcher = new JobDispatcher();
    final CalculationJob job = new CalculationJob(createJobSpecification(), 0, VersionCorrection.LATEST, null, Arrays.asList(JOB_ITEM_AB, JOB_ITEM_BC), CacheSelectHint.allShared());
    final StandardJob standard = new StandardJob(dispatcher, job, Mockito.mock(JobResultReceiver.class));
    final WatchedJob watched = standard.createWatchedJob();
    assertTrue(watched instanceof WatchedJob.Whole);
    watched.getJob().equals(job);
  }
View Full Code Here

Examples of com.opengamma.engine.calcnode.WatchedJob

    final CalculationJob job1 = new CalculationJob(createJobSpecification(), 0, VersionCorrection.LATEST, null, Arrays.asList(JOB_ITEM_AB), CacheSelectHint.privateValues(Arrays.asList(VS_B)));
    final CalculationJob job2 = new CalculationJob(createJobSpecification(), 0, VersionCorrection.LATEST, new long[] {job1.getSpecification().getJobId() }, Arrays.asList(JOB_ITEM_BC),
        CacheSelectHint.privateValues(Arrays.asList(VS_B)));
    job1.addTail(job2);
    final StandardJob standard = new StandardJob(dispatcher, job1, Mockito.mock(JobResultReceiver.class));
    final WatchedJob watched = standard.createWatchedJob();
    assertTrue(watched instanceof WholeWatchedJob);
    assertFalse(watched.getJob().getCacheSelectHint().isPrivateValue(VS_B));
    assertNull(watched.getJob().getTail());
  }
View Full Code Here

Examples of com.opengamma.engine.calcnode.WatchedJob

    final FunctionBlacklistMaintainer blacklist = Mockito.mock(FunctionBlacklistMaintainer.class);
    dispatcher.setFunctionBlacklistMaintainer(blacklist);
    final CalculationJob job = new CalculationJob(createJobSpecification(), 0, VersionCorrection.LATEST, null, Arrays.asList(JOB_ITEM_A), CacheSelectHint.allShared());
    final JobResultReceiver receiver = Mockito.mock(JobResultReceiver.class);
    final StandardJob standard = new StandardJob(dispatcher, job, receiver);
    final WatchedJob watched = new WatchedJob.Whole(standard, job, receiver);
    watched.prepareRetryJob(null);
    Mockito.verify(blacklist).failedJobItem(JOB_ITEM_A);
  }
View Full Code Here

Examples of com.opengamma.engine.calcnode.WatchedJob

    };
    final CalculationJob job = new CalculationJob(createJobSpecification(), 0, VersionCorrection.LATEST, null, Arrays.asList(JOB_ITEM_A, JOB_ITEM_AB), CacheSelectHint.privateValues(Arrays
        .asList(VS_A)));
    final JobResultReceiver receiver = Mockito.mock(JobResultReceiver.class);
    final StandardJob standard = new StandardJob(dispatcher, job, receiver);
    final WatchedJob watched = new WatchedJob.Whole(standard, job, receiver);
    final DispatchableJob split = watched.prepareRetryJob(null);
    final CalculationJob job1 = split.getJob();
    assertEquals(job1.getJobItems(), Arrays.asList(JOB_ITEM_A));
    assertFalse(job1.getCacheSelectHint().isPrivateValue(VS_A));
    final CalculationJobResult result1 = new CalculationJobResult(job1.getSpecification(), 0, Arrays.asList(CalculationJobResultItem.success()), "Test");
    split.getResultReceiver(result1).resultReceived(result1);
View Full Code Here

Examples of com.opengamma.engine.calcnode.WatchedJob

    };
    final CalculationJob job = new CalculationJob(createJobSpecification(), 0, VersionCorrection.LATEST, null, Arrays.asList(JOB_ITEM_A, JOB_ITEM_AB, JOB_ITEM_BC, JOB_ITEM_BCD),
        CacheSelectHint.sharedValues(Arrays.asList(VS_D)));
    final JobResultReceiver receiver = Mockito.mock(JobResultReceiver.class);
    final StandardJob standard = new StandardJob(dispatcher, job, receiver);
    final WatchedJob watched = new WatchedJob.Whole(standard, job, receiver);
    final DispatchableJob split = watched.prepareRetryJob(null);
    final CalculationJob job1 = split.getJob();
    assertEquals(job1.getJobItems(), Arrays.asList(JOB_ITEM_A, JOB_ITEM_AB));
    assertTrue(job1.getCacheSelectHint().isPrivateValue(VS_A));
    assertFalse(job1.getCacheSelectHint().isPrivateValue(VS_B));
    final CalculationJobResult result1 = new CalculationJobResult(job1.getSpecification(), 0, Arrays.asList(CalculationJobResultItem.success(), CalculationJobResultItem.success()), "1");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.