You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/10/03 05:25:15 UTC
[shardingsphere] branch master updated: [Issue #20387]-Add unit test for DefaultTransactionRuleConfigurationBuilder (#21305)
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 9a0608b3447 [Issue #20387]-Add unit test for DefaultTransactionRuleConfigurationBuilder (#21305)
9a0608b3447 is described below
commit 9a0608b344749a75b33ddac1d6f2fc804b352332
Author: Abhinav Koppula <ab...@gmail.com>
AuthorDate: Mon Oct 3 10:55:06 2022 +0530
[Issue #20387]-Add unit test for DefaultTransactionRuleConfigurationBuilder (#21305)
---
...ultTransactionRuleConfigurationBuilderTest.java | 49 ++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/rule/builder/DefaultTransactionRuleConfigurationBuilderTest.java b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/rule/builder/DefaultTransactionRuleConfigurationBuilderTest.java
new file mode 100644
index 00000000000..d8a50b0b722
--- /dev/null
+++ b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/rule/builder/DefaultTransactionRuleConfigurationBuilderTest.java
@@ -0,0 +1,49 @@
+/*
+ * 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.shardingsphere.transaction.rule.builder;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertNull;
+
+import java.util.Properties;
+import org.apache.shardingsphere.transaction.config.TransactionRuleConfiguration;
+import org.apache.shardingsphere.transaction.constant.TransactionOrder;
+import org.apache.shardingsphere.transaction.core.TransactionType;
+import org.junit.Test;
+
+public final class DefaultTransactionRuleConfigurationBuilderTest {
+
+ @Test
+ public void assertBuild() {
+ TransactionRuleConfiguration actual = new DefaultTransactionRuleConfigurationBuilder().build();
+ assertThat(actual.getDefaultType(), is(TransactionType.LOCAL.name()));
+ assertNull(actual.getProviderType());
+ assertThat(actual.getProps(), is(new Properties()));
+ }
+
+ @Test
+ public void assertGetOrder() {
+ assertThat(new DefaultTransactionRuleConfigurationBuilder().getOrder(), is(TransactionOrder.ORDER));
+ }
+
+ @Test
+ public void assertGetTypeClass() {
+ assertThat(new DefaultTransactionRuleConfigurationBuilder().getTypeClass().toString(), is(TransactionRuleBuilder.class.toString()));
+ }
+}