Skip to content

Commit 1407b2a

Browse files
committed
MODULE: Add gfsh create tx-grouping gw-sender cases.
1 parent bcf6e55 commit 1407b2a

File tree

2 files changed

+111
-3
lines changed

2 files changed

+111
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3+
* agreements. See the NOTICE file distributed with this work for additional information regarding
4+
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
5+
* "License"); you may not use this file except in compliance with the License. You may obtain a
6+
* copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software distributed under the License
11+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
* or implied. See the License for the specific language governing permissions and limitations under
13+
* the License.
14+
*/
15+
16+
package org.apache.geode.internal.cache.wan.txgrouping.cli.commands;
17+
18+
import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
19+
20+
import java.util.Properties;
21+
22+
import org.junit.Before;
23+
import org.junit.Rule;
24+
import org.junit.Test;
25+
26+
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
27+
import org.apache.geode.test.dunit.rules.MemberVM;
28+
import org.apache.geode.test.junit.assertions.CommandResultAssert;
29+
import org.apache.geode.test.junit.rules.GfshCommandRule;
30+
31+
public class CreateTxGroupingGatewaySenderDUnitTest {
32+
33+
@Rule
34+
public ClusterStartupRule cluster = new ClusterStartupRule();
35+
36+
@Rule
37+
public GfshCommandRule gfsh = new GfshCommandRule();
38+
39+
MemberVM locator;
40+
41+
@Before
42+
public void before() throws Exception {
43+
locator = cluster.startLocatorVM(0);
44+
cluster.startServerVM(1, new Properties(), locator.getPort());
45+
gfsh.connectAndVerify(locator);
46+
}
47+
48+
@Test
49+
public void createTxGroupingParallelGatewaySender() {
50+
addIgnoredException("could not get remote locator");
51+
52+
String createCommandString =
53+
"create gateway-sender --id=sender1 --remote-distributed-system-id=1 --parallel --group-transaction-events=true";
54+
55+
// Check command status and output
56+
CommandResultAssert createCommand =
57+
gfsh.executeAndAssertThat(createCommandString).statusIsSuccess();
58+
createCommand
59+
.hasTableSection()
60+
.hasColumn("Member")
61+
.containsExactly("server-1");
62+
63+
64+
String listCommandString = "list gateways --senders-only";
65+
CommandResultAssert listCommand =
66+
gfsh.executeAndAssertThat(listCommandString).statusIsSuccess();
67+
68+
listCommand
69+
.hasTableSection()
70+
.hasColumn("GatewaySender Id")
71+
.containsExactly("sender1");
72+
73+
listCommand
74+
.hasTableSection()
75+
.hasColumn("Type")
76+
.containsExactly("Parallel");
77+
}
78+
79+
@Test
80+
public void createTxGroupingSerialGatewaySender() {
81+
addIgnoredException("could not get remote locator");
82+
83+
String createCommandString =
84+
"create gateway-sender --id=sender1 --remote-distributed-system-id=1 --dispatcher-threads=1 --group-transaction-events=true";
85+
86+
// Check command status and output
87+
CommandResultAssert createCommand =
88+
gfsh.executeAndAssertThat(createCommandString).statusIsSuccess();
89+
createCommand
90+
.hasTableSection()
91+
.hasColumn("Member")
92+
.containsExactly("server-1");
93+
94+
95+
String listCommandString = "list gateways --senders-only";
96+
CommandResultAssert listCommand =
97+
gfsh.executeAndAssertThat(listCommandString).statusIsSuccess();
98+
99+
listCommand
100+
.hasTableSection()
101+
.hasColumn("GatewaySender Id")
102+
.containsExactly("sender1");
103+
104+
listCommand
105+
.hasTableSection()
106+
.hasColumn("Type")
107+
.containsExactly("Serial");
108+
}
109+
}

geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/wancommand/CreateDestroyGatewaySenderCommandDUnitTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ public void testCreateDestroyGatewaySenderWithSingleDispatcherThread() {
191191
+ "=ln" + " --" + CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID + "=2" + " --"
192192
+ CliStrings.CREATE_GATEWAYSENDER__MANUALSTART + "=true" + " --"
193193
+ CliStrings.CREATE_GATEWAYSENDER__SOCKETBUFFERSIZE + "=1000" + " --"
194-
+ CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS + "=1" + " --"
195-
+ CliStrings.CREATE_GATEWAYSENDER__GROUPTRANSACTIONEVENTS + "=true";
194+
+ CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS + "=1" + " --";
196195

197196
gfsh.executeAndAssertThat(command).statusIsSuccess()
198197
.doesNotContainOutput("Did not complete waiting")
@@ -204,7 +203,7 @@ public void testCreateDestroyGatewaySenderWithSingleDispatcherThread() {
204203
VMProvider.invokeInEveryMember(() -> {
205204
verifySenderState("ln", false, false);
206205
verifySenderAttributes("ln", 2, false, true, 1000, 0, false, 100, 1000, false,
207-
true, 100, 0, 1, null, null, null, true);
206+
true, 100, 0, 1, null, null, null, false);
208207
}, server1, server2, server3);
209208

210209
// destroy gateway sender and verify AEQs cleaned up

0 commit comments

Comments
 (0)