Skip to content

Commit

Permalink
Fix #81: Refactor / simplify logging facilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
simondelabici committed May 13, 2020
1 parent a31ef4c commit 123ad45
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/test/java/org/epics/ca/ChannelThroughputTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.apache.commons.lang3.time.StopWatch;
import org.epics.ca.impl.monitor.MonitorNotificationServiceFactoryCreator;
import org.epics.ca.util.logging.LibraryLogManager;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -28,7 +29,7 @@ class ChannelThroughputTests
/*- Public attributes --------------------------------------------------------*/
/*- Private attributes -------------------------------------------------------*/

private static final Logger logger = Logger.getLogger( ChannelThroughputTests.class.getName() );
private static final Logger logger = LibraryLogManager.getLogger(ChannelThroughputTests.class );

private EpicsChannelAccessTestServer server;

Expand Down Expand Up @@ -146,7 +147,7 @@ void TestPutAndMonitor( String serviceImpl, int numberOfPuts )
final NotificationConsumer<Integer> notificationConsumer = NotificationConsumer.getNormalConsumer();
notificationConsumer.clearCurrentNotificationCount();
notificationConsumer.setExpectedNotificationCount(1);
final Monitor monitor = channel.addValueMonitor(notificationConsumer);
final Monitor<Integer> monitor = channel.addValueMonitor(notificationConsumer);
notificationConsumer.awaitExpectedNotificationCount();

// Now send the requested number of puts
Expand Down Expand Up @@ -200,7 +201,7 @@ void TestFastCounterMonitor( String serviceImpl, int numberOfNotifications )
{
final Channel<Integer> channel = context.createChannel("fastCounter", Integer.class );
channel.connect();
final List<Monitor> monitorList = new ArrayList<>();
final List<Monitor<Integer>> monitorList = new ArrayList<>();

// Can optionally set here the number of monitors that will simultaneously deliver
// notifications to the CA library TCP/IP socket and thus explore the performance of
Expand Down Expand Up @@ -242,7 +243,7 @@ private static Stream<Arguments> getArgumentsForTestPutAndMonitor()
final List<String> serviceImpls = MonitorNotificationServiceFactoryCreator.getAllServiceImplementations();
final List<Integer> numberOfPuts = Arrays.asList( 100, 2000 );

return serviceImpls.stream().map( s -> numberOfPuts.stream().map( n -> Arguments.of(s, n) ) ).flatMap(s -> s);
return serviceImpls.stream().flatMap(s -> numberOfPuts.stream().map(n -> Arguments.of(s, n) ) );
}

/**
Expand All @@ -254,7 +255,7 @@ private static Stream<Arguments> getArgumentsForTestFastCounterMonitor()
final List<String> serviceImpls = MonitorNotificationServiceFactoryCreator.getAllServiceImplementations();
final List<Integer> notifications = Arrays.asList( 100, 2000 );

return serviceImpls.stream().map( s -> notifications.stream().map(n -> Arguments.of(s, n) ) ).flatMap( s -> s);
return serviceImpls.stream().flatMap(s -> notifications.stream().map(n -> Arguments.of(s, n) ) );
}

/*- Nested Classes -----------------------------------------------------------*/
Expand Down

0 comments on commit 123ad45

Please sign in to comment.