You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "ZJJ087 (via GitHub)" <gi...@apache.org> on 2023/04/10 03:24:47 UTC

[GitHub] [shardingsphere] ZJJ087 opened a new pull request, #25075: Improve properties verification of ShadowAlgorithms #24749

ZJJ087 opened a new pull request, #25075:
URL: https://github.com/apache/shardingsphere/pull/25075

   Fixes #24749.
   
   Changes proposed in this pull request:
     -Improve properties verification of ShadowAlgorithm
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [x] I have (or in comment I request) added corresponding labels for the pull request.
   - [x] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [x] I have added corresponding unit tests for my changes.
   


-- 
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


[GitHub] [shardingsphere] ZJJ087 commented on pull request #25075: Improve properties verification of ShadowAlgorithms #24749

Posted by "ZJJ087 (via GitHub)" <gi...@apache.org>.
ZJJ087 commented on PR #25075:
URL: https://github.com/apache/shardingsphere/pull/25075#issuecomment-1501880536

   @Pace2Car pls review my code, thanks :)


-- 
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


[GitHub] [shardingsphere] RaigorJiang commented on pull request #25075: Improve properties verification of ShadowAlgorithms #24749

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on PR #25075:
URL: https://github.com/apache/shardingsphere/pull/25075#issuecomment-1504834546

   @Pace2Car @ZJJ087  Merged, thank you! 


-- 
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


[GitHub] [shardingsphere] Pace2Car commented on a diff in pull request #25075: Improve properties verification of ShadowAlgorithms #24749

Posted by "Pace2Car (via GitHub)" <gi...@apache.org>.
Pace2Car commented on code in PR #25075:
URL: https://github.com/apache/shardingsphere/pull/25075#discussion_r1163657715


##########
features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/column/ColumnValueMatchShadowAlgorithmTest.java:
##########
@@ -49,4 +50,17 @@ void assertExceptionCase() {
         assertThrows(UnsupportedShadowColumnTypeException.class,
                 () -> PreciseColumnShadowValueFixtureBuilder.createExceptionCase(SHADOW_TABLE, SHADOW_COLUMN).forEach(each -> assertFalse(shadowAlgorithm.isShadow(each))));
     }
+
+    @Test
+    void assertPropertiesWithoutColumn() {
+        assertThrows(ShadowAlgorithmInitializationException.class, () ->
+                TypedSPILoader.getService(ShadowAlgorithm.class, "VALUE_MATCH", PropertiesBuilder.build(new Property("operation", "insert"), new Property("value", "1"))));
+    }
+
+    @Test
+    void assertPropertiesWithWrongOperation() {
+        assertThrows(ShadowAlgorithmInitializationException.class, () ->
+                TypedSPILoader.getService(ShadowAlgorithm.class, "VALUE_MATCH",
+                                          PropertiesBuilder.build(new Property("column", SHADOW_COLUMN), new Property("operation", "inser"), new Property("value", "1"))));

Review Comment:
   as same



-- 
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


[GitHub] [shardingsphere] ZJJ087 commented on a diff in pull request #25075: Improve properties verification of ShadowAlgorithms #24749

Posted by "ZJJ087 (via GitHub)" <gi...@apache.org>.
ZJJ087 commented on code in PR #25075:
URL: https://github.com/apache/shardingsphere/pull/25075#discussion_r1163670182


##########
features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/column/ColumnValueMatchShadowAlgorithmTest.java:
##########
@@ -49,4 +50,17 @@ void assertExceptionCase() {
         assertThrows(UnsupportedShadowColumnTypeException.class,
                 () -> PreciseColumnShadowValueFixtureBuilder.createExceptionCase(SHADOW_TABLE, SHADOW_COLUMN).forEach(each -> assertFalse(shadowAlgorithm.isShadow(each))));
     }
+
+    @Test
+    void assertPropertiesWithoutColumn() {
+        assertThrows(ShadowAlgorithmInitializationException.class, () ->
+                TypedSPILoader.getService(ShadowAlgorithm.class, "VALUE_MATCH", PropertiesBuilder.build(new Property("operation", "insert"), new Property("value", "1"))));
+    }
+
+    @Test
+    void assertPropertiesWithWrongOperation() {
+        assertThrows(ShadowAlgorithmInitializationException.class, () ->
+                TypedSPILoader.getService(ShadowAlgorithm.class, "VALUE_MATCH",
+                                          PropertiesBuilder.build(new Property("column", SHADOW_COLUMN), new Property("operation", "inser"), new Property("value", "1"))));

Review Comment:
   done



-- 
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


[GitHub] [shardingsphere] Pace2Car commented on a diff in pull request #25075: Improve properties verification of ShadowAlgorithms #24749

Posted by "Pace2Car (via GitHub)" <gi...@apache.org>.
Pace2Car commented on code in PR #25075:
URL: https://github.com/apache/shardingsphere/pull/25075#discussion_r1163657617


##########
features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/column/ColumnRegexMatchShadowAlgorithmTest.java:
##########
@@ -49,4 +50,17 @@ void assertExceptionCase() {
         assertThrows(UnsupportedShadowColumnTypeException.class,
                 () -> PreciseColumnShadowValueFixtureBuilder.createExceptionCase(SHADOW_TABLE, SHADOW_COLUMN).forEach(each -> assertFalse(shadowAlgorithm.isShadow(each))));
     }
+
+    @Test
+    void assertPropertiesWithoutColumn() {
+        assertThrows(ShadowAlgorithmInitializationException.class, () ->
+                TypedSPILoader.getService(ShadowAlgorithm.class, "REGEX_MATCH", PropertiesBuilder.build(new Property("operation", "insert"), new Property("value", "[1]"))));
+    }
+
+    @Test
+    void assertPropertiesWithWrongOperation() {
+        assertThrows(ShadowAlgorithmInitializationException.class, () ->
+                TypedSPILoader.getService(ShadowAlgorithm.class, "REGEX_MATCH",
+                                          PropertiesBuilder.build(new Property("column", SHADOW_COLUMN), new Property("operation", "inser"), new Property("value", "[1]"))));

Review Comment:
   Replacing `inser` with `wrong` is more explicit.



-- 
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


[GitHub] [shardingsphere] RaigorJiang merged pull request #25075: Improve properties verification of ShadowAlgorithms #24749

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang merged PR #25075:
URL: https://github.com/apache/shardingsphere/pull/25075


-- 
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


[GitHub] [shardingsphere] ZJJ087 commented on pull request #25075: Improve properties verification of ShadowAlgorithms #24749

Posted by "ZJJ087 (via GitHub)" <gi...@apache.org>.
ZJJ087 commented on PR #25075:
URL: https://github.com/apache/shardingsphere/pull/25075#issuecomment-1504673886

   > @ZJJ087 Hi, please keep the indentation of the blank line consistent with the previous line.
   
   done


-- 
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


[GitHub] [shardingsphere] Pace2Car commented on pull request #25075: Improve properties verification of ShadowAlgorithms #24749

Posted by "Pace2Car (via GitHub)" <gi...@apache.org>.
Pace2Car commented on PR #25075:
URL: https://github.com/apache/shardingsphere/pull/25075#issuecomment-1502601230

   @ZJJ087  Hi, please keep the indentation of the blank line consistent with the previous line.


-- 
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