Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Configuration Tests and Configured Jacoco #56

Conversation

SanHalacogluImproving
Copy link

Added Configuration Tests and added jacoco.
Applied Spotless.
Removed RequestBuilder.

@acarbonetto acarbonetto force-pushed the java/integ_acarbo_refactor_api_submitRequests branch from cb1966e to cada9b7 Compare January 11, 2024 21:38
Comment on lines 89 to 90
public static List createSetOptions(SetOptions options) {
List optionArgs = new LinkedList();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static List createSetOptions(SetOptions options) {
List optionArgs = new LinkedList();
public static List<String> createSetOptions(SetOptions options) {
List<String> optionArgs = new LinkedList<>();

} else {
if (options.expiry.count == null) {
throw new RequestException(
"Set command received expiry type " + options.expiry.type + "but count was not set.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Set command received expiry type " + options.expiry.type + "but count was not set.");
"Set command received expiry type " + options.expiry.type + ", but count was not set.");

acarbonetto and others added 9 commits January 16, 2024 14:38
Signed-off-by: Andrew Carbonetto <[email protected]>
* Add base command; add custom command

---------

Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
…entloopGroup and channel configuration for Netty.
Removed wildcard imports.
Fixed wording in documentation.
Applied Spotless.
Removed RequestBuilder.
Signed-off-by: Andrew Carbonetto <[email protected]>
@acarbonetto acarbonetto force-pushed the java/dev_SanH_configuration_tests branch from 71556d3 to b9c9ee4 Compare January 17, 2024 22:53
@acarbonetto acarbonetto changed the base branch from java/integ_acarbo_refactor_api_submitRequests to java/dev_SanH_ThreadPoolResourceAllocator January 17, 2024 22:53
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline?

Comment on lines +71 to +77
assertEquals(new ArrayList<NodeAddress>(), redisClientConfiguration.getAddresses());
assertFalse(redisClientConfiguration.isUseTLS());
assertEquals(ReadFrom.PRIMARY, redisClientConfiguration.getReadFrom());
assertNull(redisClientConfiguration.getCredentials());
assertNull(redisClientConfiguration.getRequestTimeout());
assertNull(redisClientConfiguration.getDatabaseId());
assertNull(redisClientConfiguration.getReconnectStrategy());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertAll?

() -> assertEquals(expectedNodeAddress.getPort(), actualNodeAddress.getPort()));
}
assertTrue(redisClientConfiguration.isUseTLS());
assertEquals(ReadFrom.PREFER_REPLICA, redisClientConfiguration.getReadFrom());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here (and below too)

Comment on lines +130 to +133
assertEquals(connectionManager, client.connectionManager);
assertEquals(commandManager, client.commandManager);
} catch (Exception cancellationException) {
assertTrue(cancellationException instanceof CancellationException);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one branch should succceed. If you test cancellation, add fail() into try block

Comment on lines +161 to +164
assertEquals(connectionManager, client.connectionManager);
assertEquals(commandManager, client.commandManager);
} catch (Exception exception) {
assertEquals(interruptedException, exception.getCause());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here is the same


@Test
public void getOrCreateReturnsDefault() {
(new ThreadPoolResourceAllocator.ShutdownHook()).run();
(new DefaultThreadPoolResourceHandler.ShutdownHook()).run();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(new DefaultThreadPoolResourceHandler.ShutdownHook()).run();
new DefaultThreadPoolResourceHandler.ShutdownHook().run();

@@ -38,6 +39,6 @@ public void getOrCreateReturnsDefault() {
// remove the mocked resource
EventLoopGroup mockedELG = mock(EventLoopGroup.class);
when(mockedThreadPool.getEventLoopGroup()).thenReturn(mockedELG);
(new ThreadPoolResourceAllocator.ShutdownHook()).run();
(new DefaultThreadPoolResourceHandler.ShutdownHook()).run();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(new DefaultThreadPoolResourceHandler.ShutdownHook()).run();
new DefaultThreadPoolResourceHandler.ShutdownHook().run();

@SanHalacogluImproving SanHalacogluImproving force-pushed the java/dev_SanH_ThreadPoolResourceAllocator branch 3 times, most recently from 5cc435d to 26fc46d Compare January 24, 2024 22:41
@SanHalacogluImproving SanHalacogluImproving deleted the branch java/dev_SanH_ThreadPoolResourceAllocator February 6, 2024 17:42
@acarbonetto acarbonetto deleted the java/dev_SanH_configuration_tests branch February 23, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants