You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/17 11:11:16 UTC

[GitHub] [shardingsphere] fwhdzh commented on a change in pull request #12527: Add unit test of StandalonePersistRepositoryConfigurationYamlSwapper.

fwhdzh commented on a change in pull request #12527:
URL: https://github.com/apache/shardingsphere/pull/12527#discussion_r710965870



##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryConfigurationYamlSwapperTest.java
##########
@@ -0,0 +1,61 @@
+/*
+ * 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.mode.manager.standalone;
+
+import org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfiguration;
+import org.apache.shardingsphere.mode.manager.standalone.yaml.StandalonePersistRepositoryConfigurationYamlSwapper;
+import org.apache.shardingsphere.mode.repository.standalone.StandalonePersistRepositoryConfiguration;
+import org.junit.Test;
+
+import java.util.Properties;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public final class StandalonePersistRepositoryConfigurationYamlSwapperTest {
+
+    @Test
+    public void assertSwapToYamlConfiguration() {
+        final String testType = "testType";
+        Properties testProps = new Properties();
+        StandalonePersistRepositoryConfiguration standalonePersistRepositoryConfiguration = new StandalonePersistRepositoryConfiguration(testType, testProps);
+        StandalonePersistRepositoryConfigurationYamlSwapper standalonePersistRepositoryConfigurationYamlSwapper = new StandalonePersistRepositoryConfigurationYamlSwapper();

Review comment:
       Emm...in other issue, another supervisor asked me to use local variables as possible. 
   "Minimize the use of variables. The life cycle of the constant defined in the class is bound to the bytecode file.If xxx is only used in methods, use local variables. The life cycle of the variable is bound to the method." (issue 12159)
   Should I use local variable or member variable?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org