Package com.opengamma.engine.exec

Source Code of com.opengamma.engine.exec.BatchExecutorFactoryTest

/**
* Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.engine.exec;

import static org.testng.Assert.assertEquals;

import org.mockito.Mockito;
import org.testng.annotations.Test;

import com.opengamma.engine.view.cycle.SingleComputationCycle;
import com.opengamma.util.test.TestGroup;

/**
* Tests the {@link BatchExecutorFactory} class
*/
@Test(groups = TestGroup.UNIT)
public class BatchExecutorFactoryTest {

  public void testCreateExecutor() {
    final BatchExecutorFactory factory = new BatchExecutorFactory(new SingleNodeExecutorFactory());
    final SingleComputationCycle cycle = Mockito.mock(SingleComputationCycle.class);
    final DependencyGraphExecutor executor = factory.createExecutor(cycle);
    assertEquals(executor.getClass(), BatchExecutor.class);
  }

  public void testToString() {
    final BatchExecutorFactory factory = new BatchExecutorFactory(new SingleNodeExecutorFactory());
    assertEquals(factory.toString(), "BatchExecutorFactory delegating to SingleNodeExecutorFactory");
  }

}
TOP

Related Classes of com.opengamma.engine.exec.BatchExecutorFactoryTest

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.