Package com.opengamma.engine.calcnode.RemoteNodeServer

Examples of com.opengamma.engine.calcnode.RemoteNodeServer.FunctionBlacklistMaintainerProviderBean


    final StaticFunctionBlacklistMaintainerProvider provider = new StaticFunctionBlacklistMaintainerProvider(maintainer);
    assertSame(provider.getUpdate("Foo"), maintainer);
  }

  public void testFunctionBlacklistMaintainerProviderBean_emptyPolicy() {
    final FunctionBlacklistMaintainerProviderBean bean = new FunctionBlacklistMaintainerProviderBean();
    bean.setBlacklistProvider(Mockito.mock(ManageableFunctionBlacklistProvider.class));
    bean.setBlacklistPrefix("BL_");
    bean.setBlacklistPolicy(new EmptyFunctionBlacklistPolicy());
    assertNull(bean.getUpdate("Foo"));
  }
View Full Code Here


  }

  public void testFunctionBlacklistMaintainerProviderBean_livePolicy() {
    final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
    try {
      final FunctionBlacklistMaintainerProviderBean bean = new FunctionBlacklistMaintainerProviderBean();
      final ManageableFunctionBlacklistProvider provider = Mockito.mock(ManageableFunctionBlacklistProvider.class);
      final ManageableFunctionBlacklist blacklist = Mockito.mock(ManageableFunctionBlacklist.class);
      Mockito.when(provider.getBlacklist("BL_Foo")).thenReturn(blacklist);
      bean.setBlacklistProvider(provider);
      bean.setBlacklistPrefix("BL_");
      bean.setBlacklistPolicy(new DefaultFunctionBlacklistPolicy(UniqueId.of("Test", "Foo"), 60, Arrays.asList(FunctionBlacklistPolicy.Entry.WILDCARD)));
      final FunctionBlacklistMaintainer maintainer = bean.getUpdate("Foo");
      maintainer.failedJobItem(JOB_ITEM);
      Mockito.verify(blacklist).addBlacklistRule(new FunctionBlacklistRule(), 60);
    } finally {
      scheduler.shutdown();
    }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.calcnode.RemoteNodeServer.FunctionBlacklistMaintainerProviderBean

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.