Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wip/wan tx grouping module 1#7083

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
albertogpz wants to merge20 commits intoapache:develop
base:develop
Choose a base branch
Loading
fromNordix:wip/wan-tx-grouping-module_1
Draft
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
20 commits
Select commitHold shift + click to select a range
042013d
GEODE-6588: Cleanup GatewaySenderAttributes
jake-at-workSep 30, 2021
2457963
GEODE-6588: Cleanup AbstractGatewaySender
jake-at-workSep 30, 2021
8c2d23e
GEODE-6588: Cleanup GatewaySenderFactoryImpl
jake-at-workOct 1, 2021
ae74a42
MODULE: Extract interface for GatewaySenderAttributes.
jake-at-workSep 30, 2021
7a3d45c
MODULE: Split out some factories.
jake-at-workOct 13, 2021
35b072e
MODULE: Extract out TX grouping factories.
jake-at-workOct 13, 2021
f7c0d21
MODULE: Create TX grouping sender impls.
jake-at-workOct 13, 2021
477a823
MODULE: Remove AbstractGatwaySender.mustGroupTransactionEvents()
jake-at-workOct 13, 2021
0be467b
MODULE: Stupid simple module.
jake-at-workOct 13, 2021
07884e8
MODULE: ServiceLoader
jake-at-workOct 14, 2021
5aa6bc7
MODULE: Move tests
jake-at-workOct 14, 2021
1959233
MODULE: Move remaining tx-grouping functionality and DUnit tests
albertogpzNov 5, 2021
74f9274
MODULE: Fix some GatewaySenderFactoryImpl tests
albertogpzNov 5, 2021
a7416a3
MODULE: Do not allow changing group-transaction-events
albertogpzNov 5, 2021
0c3d814
MODULE: Add gfsh create tx-grouping gw-sender cases.
albertogpzNov 5, 2021
43194d0
Updated with Kirk's first review comments
albertogpzDec 2, 2021
cbe859d
remove() refactored as suggested on jbarrett's review
albertogpzDec 13, 2021
8c2f77d
Use --type=TxGroupingParallelGatewaySender... as suggested in jbarret…
albertogpzDec 14, 2021
77db403
Added exceptions to public API changes
albertogpzDec 14, 2021
4ce6664
Fix tests
albertogpzDec 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
MODULE: Move tests
  • Loading branch information
@jake-at-work@albertogpz
jake-at-work authored andalbertogpz committedFeb 4, 2022
commit5aa6bc7bc25d3f7d2f20d7b2ab9b31d40aacaedc
7 changes: 7 additions & 0 deletionsgeode-wan-txgrouping/build.gradle
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,4 +32,11 @@ dependencies {
implementation(project(':geode-serialization'))
implementation(project(':geode-core'))


// test
testImplementation(project(':geode-junit'))
testImplementation('org.assertj:assertj-core')
testImplementation('junit:junit')
testImplementation('org.mockito:mockito-core')

}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package org.apache.geode.cache.wan.internal.txgrouping.parallel;

import static org.assertj.core.api.Assertions.assertThatNoException;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import org.junit.Test;

import org.apache.geode.internal.cache.wan.GatewaySenderException;
import org.apache.geode.internal.cache.wan.MutableGatewaySenderAttributes;

public class TxGroupingParallelGatewaySenderTypeFactoryTest {

final TxGroupingParallelGatewaySenderTypeFactory factory =
new TxGroupingParallelGatewaySenderTypeFactory();

@Test
public void validateThrowsIfBatchConflationEnabled() {
final MutableGatewaySenderAttributes attributes = mock(MutableGatewaySenderAttributes.class);
when(attributes.isBatchConflationEnabled()).thenReturn(true);

assertThatThrownBy(() -> factory.validate(attributes))
.isInstanceOf(GatewaySenderException.class)
.hasMessageContaining(
"both group transaction events set to true and batch conflation enabled");
}

@Test
public void validateDoesNotThrowsIfBatchConflationDisabled() {
final MutableGatewaySenderAttributes attributes = mock(MutableGatewaySenderAttributes.class);
when(attributes.isBatchConflationEnabled()).thenReturn(false);

assertThatNoException().isThrownBy(() -> factory.validate(attributes));
}

}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package org.apache.geode.cache.wan.internal.txgrouping.serial;

import static org.assertj.core.api.Assertions.assertThatNoException;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import org.junit.Test;

import org.apache.geode.internal.cache.wan.GatewaySenderException;
import org.apache.geode.internal.cache.wan.MutableGatewaySenderAttributes;

public class TxGroupingSerialGatewaySenderTypeFactoryTest {

final TxGroupingSerialGatewaySenderTypeFactory factory =
new TxGroupingSerialGatewaySenderTypeFactory();

final MutableGatewaySenderAttributes attributes = mock(MutableGatewaySenderAttributes.class);

@Test
public void validateThrowsIfBatchConflationEnabled() {
when(attributes.isBatchConflationEnabled()).thenReturn(true);

assertThatThrownBy(() -> factory.validate(attributes))
.isInstanceOf(GatewaySenderException.class)
.hasMessageContaining(
"both group transaction events set to true and batch conflation enabled");
}

@Test
public void validateDoesNotThrowsIfBatchConflationDisabled() {
when(attributes.isBatchConflationEnabled()).thenReturn(false);

assertThatNoException().isThrownBy(() -> factory.validate(attributes));
}

@Test
public void validateThrowsIfDispatcherThreadsGreaterThan1() {
when(attributes.getDispatcherThreads()).thenReturn(2);

assertThatThrownBy(() -> factory.validate(attributes))
.isInstanceOf(GatewaySenderException.class).hasMessageContaining(
"cannot be created with group transaction events set to true when dispatcher threads is greater than 1");
}

@Test
public void validateDoesNotThrow() {
when(attributes.getDispatcherThreads()).thenReturn(1);

assertThatNoException().isThrownBy(() -> factory.validate(attributes));
}


}
3 changes: 0 additions & 3 deletionsgeode-wan/build.gradle
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,9 +41,6 @@ dependencies {
testImplementation('junit:junit')
testImplementation('org.mockito:mockito-core')

// TODO jbarrett remove
testRuntimeOnly(project(':geode-wan-txgrouping'))

integrationTestImplementation(project(':geode-junit'))
integrationTestImplementation('org.assertj:assertj-core')
integrationTestImplementation('junit:junit')
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp