コード例 #1
0
 /** Sets up the global values for all the tests. */
 @Before
 public void setUpTest() {
   ServiceDirectory testDirectory =
       new TestServiceDirectory()
           .add(ControlPlaneMonitorService.class, mockControlPlaneMonitorService);
   BaseResource.setServiceDirectory(testDirectory);
 }
コード例 #2
0
 /** Sets up mocked config service. */
 @Before
 public void setUpMocks() {
   mockNetworkConfigService = new MockNetworkConfigService();
   ServiceDirectory testDirectory =
       new TestServiceDirectory().add(NetworkConfigService.class, mockNetworkConfigService);
   BaseResource.setServiceDirectory(testDirectory);
 }
コード例 #3
0
  /** Sets up the global values for all the tests. */
  @Before
  public void setUpTest() {
    SfcCodecContext context = new SfcCodecContext();

    ServiceDirectory testDirectory =
        new TestServiceDirectory()
            .add(FlowClassifierService.class, flowClassifierService)
            .add(CodecService.class, context.codecManager());
    BaseResource.setServiceDirectory(testDirectory);
  }
コード例 #4
0
  /** Initializes test mocks and environment. */
  @Before
  public void setUpTest() {
    mockMetricsService = createMock(MetricsService.class);

    // Register the services needed for the test
    final CodecManager codecService = new CodecManager();
    codecService.activate();
    ServiceDirectory testDirectory =
        new TestServiceDirectory()
            .add(MetricsService.class, mockMetricsService)
            .add(CodecService.class, codecService);
    BaseResource.setServiceDirectory(testDirectory);
  }