[GitHub] [incubator-shardingsphere] kimmking commented on a change in pull request #4922: Test case of OrchestrationProperties and NacosProperties

2020-03-25 Thread GitBox
kimmking commented on a change in pull request #4922: Test case of 
OrchestrationProperties and NacosProperties
URL: 
https://github.com/apache/incubator-shardingsphere/pull/4922#discussion_r397669264
 
 

 ##
 File path: 
sharding-orchestration/sharding-orchestration-core/sharding-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/properties/OrchestrationPropertiesTest.java
 ##
 @@ -0,0 +1,44 @@
+/*
+ * 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.orchestration.core.facade.properties;
+
+import org.junit.Test;
+
+import java.util.Properties;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public final class OrchestrationPropertiesTest {
+
+@Test
+public void assertGetValue() {
+Properties props = new Properties();
+props.setProperty(OrchestrationPropertyKey.OVERWRITE.getKey(), "true");
+OrchestrationProperties actual = new OrchestrationProperties(props);
+assertTrue(actual.getValue(OrchestrationPropertyKey.OVERWRITE));
+}
+
+@Test
+public void assertGetDefaultValue() {
+Properties props = new Properties();
+OrchestrationProperties actual = new OrchestrationProperties(props);
+assertFalse(actual.getValue(OrchestrationPropertyKey.OVERWRITE));
+}
+
+}
 
 Review comment:
   let an empty line here


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] kimmking commented on a change in pull request #4922: Test case of OrchestrationProperties and NacosProperties

2020-03-25 Thread GitBox
kimmking commented on a change in pull request #4922: Test case of 
OrchestrationProperties and NacosProperties
URL: 
https://github.com/apache/incubator-shardingsphere/pull/4922#discussion_r397642595
 
 

 ##
 File path: 
sharding-orchestration/sharding-orchestration-center/sharding-orchestration-center-nacos/src/test/java/org/apache/shardingsphere/orchestration/center/instance/NacosPropertiesTest.java
 ##
 @@ -0,0 +1,47 @@
+/*
+ * 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.orchestration.center.instance;
+
+import org.junit.Test;
+
+import java.util.Properties;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public final class NacosPropertiesTest {
+
+@Test
+public void assertGetValue() {
+Properties props = new Properties();
+props.setProperty(NacosPropertyKey.GROUP.getKey(), 
"SHARDING_SPHERE_TEST_GROUP");
+props.setProperty(NacosPropertyKey.TIMEOUT.getKey(), "6000");
+NacosProperties actual = new NacosProperties(props);
+assertThat(actual.getValue(NacosPropertyKey.GROUP), 
is("SHARDING_SPHERE_TEST_GROUP"));
+assertThat(actual.getValue(NacosPropertyKey.TIMEOUT), is(6000L));
+}
+
+@Test
+public void assertGetDefaultValue() {
+Properties props = new Properties();
+NacosProperties actual = new NacosProperties(props);
+assertThat(actual.getValue(NacosPropertyKey.GROUP), 
is("SHARDING_SPHERE_DEFAULT_GROUP"));
+assertThat(actual.getValue(NacosPropertyKey.TIMEOUT), is(3000L));
+}
+
+}
 
 Review comment:
   let a blank line at tail.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] kimmking commented on a change in pull request #4922: Test case of OrchestrationProperties and NacosProperties

2020-03-25 Thread GitBox
kimmking commented on a change in pull request #4922: Test case of 
OrchestrationProperties and NacosProperties
URL: 
https://github.com/apache/incubator-shardingsphere/pull/4922#discussion_r397642375
 
 

 ##
 File path: 
sharding-orchestration/sharding-orchestration-center/sharding-orchestration-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/orchestration/center/instance/ZookeeperPropertiesTest.java
 ##
 @@ -25,7 +25,7 @@
 import static org.junit.Assert.assertThat;
 
 public final class ZookeeperPropertiesTest {
-
 
 Review comment:
   should keep origin blankspaces


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] kimmking commented on a change in pull request #4922: Test case of OrchestrationProperties and NacosProperties

2020-03-25 Thread GitBox
kimmking commented on a change in pull request #4922: Test case of 
OrchestrationProperties and NacosProperties
URL: 
https://github.com/apache/incubator-shardingsphere/pull/4922#discussion_r397642508
 
 

 ##
 File path: 
sharding-orchestration/sharding-orchestration-core/sharding-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/properties/OrchestrationPropertiesTest.java
 ##
 @@ -0,0 +1,44 @@
+/*
+ * 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.orchestration.core.facade.properties;
+
+import org.junit.Test;
+
+import java.util.Properties;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public final class OrchestrationPropertiesTest {
+
+@Test
+public void assertGetValue() {
+Properties props = new Properties();
+props.setProperty(OrchestrationPropertyKey.OVERWRITE.getKey(), "true");
+OrchestrationProperties actual = new OrchestrationProperties(props);
+assertTrue(actual.getValue(OrchestrationPropertyKey.OVERWRITE));
+}
+
+@Test
+public void assertGetDefaultValue() {
+Properties props = new Properties();
+OrchestrationProperties actual = new OrchestrationProperties(props);
+assertFalse(actual.getValue(OrchestrationPropertyKey.OVERWRITE));
+}
+
+}
 
 Review comment:
   let a blank line at tail


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services