You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/12 03:52:23 UTC

[GitHub] [spark] LuciferYang opened a new pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

LuciferYang opened a new pull request #31815:
URL: https://github.com/apache/spark/pull/31815


   ### What changes were proposed in this pull request?
   The main change of this pr as follows:
   
   - Use `org.junit.Assert.assertThrows(String, Class, ThrowingRunnable)` method instead of  `ExpectedException.none()`
   - Use `org.hamcrest.MatcherAssert.assertThat()` method instead of   `org.junit.Assert.assertThat(T, org.hamcrest.Matcher<? super T>)`
   
   ### Why are the changes needed?
   Clean up deprecated API usage
   
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   
   ### How was this patch tested?
   Pass the Jenkins or GitHub Action
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31815:
URL: https://github.com/apache/spark/pull/31815#issuecomment-797229606


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40574/
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun closed pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #31815:
URL: https://github.com/apache/spark/pull/31815


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang closed pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
LuciferYang closed pull request #31815:
URL: https://github.com/apache/spark/pull/31815


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #31815:
URL: https://github.com/apache/spark/pull/31815#issuecomment-797505565


   The change itself looks fine. Just out of curiosity; which API is deprecated? I couldn't find methods with`@deprecated`  though.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang edited a comment on pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
LuciferYang edited a comment on pull request #31815:
URL: https://github.com/apache/spark/pull/31815#issuecomment-799050357


   @maropu methods with @deprecated as follows:
   
   1. org.junit.rules.ExpectedException.none()
   
   https://github.com/junit-team/junit4/blob/9ad61c6bf757be8d8968fd5977ab3ae15b0c5aba/src/main/java/org/junit/rules/ExpectedException.java#L111-L124
   
   ```
       /**
        * Returns a {@linkplain TestRule rule} that expects no exception to
        * be thrown (identical to behavior without this rule).
        *
        * @deprecated Since 4.13
        * {@link org.junit.Assert#assertThrows(Class, org.junit.function.ThrowingRunnable)
        * Assert.assertThrows} can be used to verify that your code throws a specific
        * exception.
        */
       @Deprecated
       public static ExpectedException none() {
           return new ExpectedException();
       }
   ```
   
   
   2. org.junit.Assert#assertThat(T, org.hamcrest.Matcher<? super T>)
   
   https://github.com/junit-team/junit4/blob/9ad61c6bf757be8d8968fd5977ab3ae15b0c5aba/src/main/java/org/junit/Assert.java#L902-L931
   
   
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #31815:
URL: https://github.com/apache/spark/pull/31815#issuecomment-799054674


   Sorry to have close this pr by mistake
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31815:
URL: https://github.com/apache/spark/pull/31815#issuecomment-799152415


   > Sorry to have close this pr by mistake
   
   No problem at all~


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #31815:
URL: https://github.com/apache/spark/pull/31815#issuecomment-799178596


   thx all ~


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #31815:
URL: https://github.com/apache/spark/pull/31815#issuecomment-799048408


   > Are these all instances, @LuciferYang ?
   
   Yes


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang edited a comment on pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
LuciferYang edited a comment on pull request #31815:
URL: https://github.com/apache/spark/pull/31815#issuecomment-799050357


   @maropu methods with @deprecated as follows:
   
   1. org.junit.rules.ExpectedException.none()
   
   https://github.com/junit-team/junit4/blob/9ad61c6bf757be8d8968fd5977ab3ae15b0c5aba/src/main/java/org/junit/rules/ExpectedException.java#L111-L124
   
   ```
       /**
        * Returns a {@linkplain TestRule rule} that expects no exception to
        * be thrown (identical to behavior without this rule).
        *
        * @deprecated Since 4.13
        * {@link org.junit.Assert#assertThrows(Class, org.junit.function.ThrowingRunnable)
        * Assert.assertThrows} can be used to verify that your code throws a specific
        * exception.
        */
       @Deprecated
       public static ExpectedException none() {
           return new ExpectedException();
       }
   ```
   
   2. org.junit.Assert#assertThat(T, org.hamcrest.Matcher<? super T>)
   
   https://github.com/junit-team/junit4/blob/9ad61c6bf757be8d8968fd5977ab3ae15b0c5aba/src/main/java/org/junit/Assert.java#L902-L931
   
   ```
   /**
        * Asserts that <code>actual</code> satisfies the condition specified by
        * <code>matcher</code>. If not, an {@link AssertionError} is thrown with
        * information about the matcher and failing value. Example:
        *
        * <pre>
        *   assertThat(0, is(1)); // fails:
        *     // failure message:
        *     // expected: is &lt;1&gt;
        *     // got value: &lt;0&gt;
        *   assertThat(0, is(not(1))) // passes
        * </pre>
        *
        * <code>org.hamcrest.Matcher</code> does not currently document the meaning
        * of its type parameter <code>T</code>.  This method assumes that a matcher
        * typed as <code>Matcher&lt;T&gt;</code> can be meaningfully applied only
        * to values that could be assigned to a variable of type <code>T</code>.
        *
        * @param <T> the static type accepted by the matcher (this can flag obvious
        * compile-time problems such as {@code assertThat(1, is("a"))}
        * @param actual the computed value being compared
        * @param matcher an expression, built of {@link Matcher}s, specifying allowed
        * values
        * @see org.hamcrest.CoreMatchers
        * @deprecated use {@code org.hamcrest.MatcherAssert.assertThat()}
        */
       @Deprecated
       public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
           assertThat("", actual, matcher);
       }
   ```
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31815:
URL: https://github.com/apache/spark/pull/31815#issuecomment-797243479


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135990/
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on pull request #31815: [SPARK-34722][CORE][SQL][TEST] Clean up deprecated API usage related to JUnit4

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #31815:
URL: https://github.com/apache/spark/pull/31815#issuecomment-799050357


   @maropu methods with @deprecated as follows:
   
   1. org.junit.rules.ExpectedException.none()
   
   https://github.com/junit-team/junit4/blob/9ad61c6bf757be8d8968fd5977ab3ae15b0c5aba/src/main/java/org/junit/rules/ExpectedException.java#L111-L124
   
   
   2. org.junit.Assert#assertThat(T, org.hamcrest.Matcher<? super T>)
   
   https://github.com/junit-team/junit4/blob/9ad61c6bf757be8d8968fd5977ab3ae15b0c5aba/src/main/java/org/junit/Assert.java#L902-L931
   
   
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org