You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/05/15 05:10:17 UTC

[GitHub] [ozone] kaijchen opened a new pull request, #3417: HDDS-6750. Migrate simple tests in hdds-server-scm to JUnit5

kaijchen opened a new pull request, #3417:
URL: https://github.com/apache/ozone/pull/3417

   ## What changes were proposed in this pull request?
   
   Migrate simple tests in hdds-server-scm to JUnit5, in which "simple" means without `@Rule` and `@RunWith`.
   
   Steps of the migration, each corresponding to one commit:
   
   1. Run the following `sed` command against each file to substitute the class names.
   2. Fix errors mannually (5183e35ce8b30b9669b61e2c8e8c85c0f12fe03e).
   3. Fix checkstyle (LineLength).
   
   ``` bash
   sed -i $1 \
   	-e 's/org.junit.After;/org.junit.jupiter.api.AfterEach;/' \
   	-e 's/@After$/@AfterEach/' \
   	-e 's/org.junit.AfterClass;/org.junit.jupiter.api.AfterAll;/' \
   	-e 's/@AfterClass$/@AfterAll/' \
   	-e 's/org.junit.Before;/org.junit.jupiter.api.BeforeEach;/' \
   	-e 's/@Before$/@BeforeEach/' \
   	-e 's/org.junit.BeforeClass;/org.junit.jupiter.api.BeforeAll;/' \
   	-e 's/@BeforeClass$/@BeforeAll/' \
   	-e 's/org.junit.Test/org.junit.jupiter.api.Test/' \
   	-e 's/org.junit.Assert/org.junit.jupiter.api.Assertions/' \
   	-e 's/junit.framework.TestCase/org.junit.jupiter.api.Assertions/' \
   	-e 's/Assert\./Assertions./'
   ```
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-6750
   
   ## How was this patch tested?
   
   Full CI: https://github.com/kaijchen/ozone/actions/runs/2326163256


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai merged pull request #3417: HDDS-6750. Migrate simple tests in hdds-server-scm to JUnit5

Posted by GitBox <gi...@apache.org>.
adoroszlai merged PR #3417:
URL: https://github.com/apache/ozone/pull/3417


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a diff in pull request #3417: HDDS-6750. Migrate simple tests in hdds-server-scm to JUnit5

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on code in PR #3417:
URL: https://github.com/apache/ozone/pull/3417#discussion_r874625006


##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestDatanodeAdminMonitor.java:
##########
@@ -84,7 +84,7 @@ public void setup() throws IOException, AuthenticationException {
         new DatanodeAdminMonitorImpl(conf, eventQueue, nodeManager, repManager);
   }
 
-  @After
+  @AfterEach
   public void teardown() {
   }

Review Comment:
   Can be removed.



##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestNodeStateManager.java:
##########
@@ -90,7 +90,7 @@ public char[] getPassword(String key) throws IOException {
     nsm = new NodeStateManager(conf, eventPublisher, mockVersionManager);
   }
 
-  @After
+  @AfterEach
   public void tearDown() {
   }

Review Comment:
   Looks like this empty tear down method can be removed.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] kaijchen commented on pull request #3417: HDDS-6750. Migrate simple tests in hdds-server-scm to JUnit5

Posted by GitBox <gi...@apache.org>.
kaijchen commented on PR #3417:
URL: https://github.com/apache/ozone/pull/3417#issuecomment-1128680596

   Thanks for reviewing @adoroszlai.


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org