[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2019-08-03 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16899407#comment-16899407
 ] 

ASF subversion and git services commented on SOLR-12555:


Commit 488c75fb555cdf704cf93b66cc0fdafe2896d159 in lucene-solr's branch 
refs/heads/branch_8x from Munendra S N
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=488c75f ]

SOLR-12555: use expectThrows() to verify the ex thrown in tests


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Components: Tests
>Affects Versions: 8.0
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.patch, 
> SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2019-08-03 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16899404#comment-16899404
 ] 

ASF subversion and git services commented on SOLR-12555:


Commit 8c4fde94fe93c70b95ed3563fb65972bb303e0af in lucene-solr's branch 
refs/heads/master from Munendra S N
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=8c4fde9 ]

SOLR-12555: use expectThrows() to verify the ex thrown in tests


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Components: Tests
>Affects Versions: 8.0
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.patch, 
> SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2019-07-29 Thread Lucene/Solr QA (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16895713#comment-16895713
 ] 

Lucene/Solr QA commented on SOLR-12555:
---

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 89 new or modified test 
files. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  6m 
38s{color} | {color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  5m 
42s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  5m 
42s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Release audit (RAT) {color} | 
{color:green}  1m 45s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Check forbidden APIs {color} | 
{color:green}  1m 22s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Validate source patterns {color} | 
{color:green}  1m 22s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  1m 
27s{color} | {color:green} dataimporthandler in the patch passed. {color} |
| {color:red}-1{color} | {color:red} unit {color} | {color:red}  0m 15s{color} 
| {color:red} extraction in the patch failed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  1m  
6s{color} | {color:green} ltr in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
52s{color} | {color:green} velocity in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green} 51m 
22s{color} | {color:green} core in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  7m 
10s{color} | {color:green} solrj in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
22s{color} | {color:green} test-framework in the patch passed. {color} |
| {color:black}{color} | {color:black} {color} | {color:black} 79m 34s{color} | 
{color:black} {color} |
\\
\\
|| Subsystem || Report/Notes ||
| JIRA Issue | SOLR-12555 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/12976134/SOLR-12555.patch |
| Optional Tests |  compile  javac  unit  ratsources  checkforbiddenapis  
validatesourcepatterns  |
| uname | Linux lucene2-us-west.apache.org 4.4.0-112-generic #135-Ubuntu SMP 
Fri Jan 19 11:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | ant |
| Personality | 
/home/jenkins/jenkins-slave/workspace/PreCommit-SOLR-Build/sourcedir/dev-tools/test-patch/lucene-solr-yetus-personality.sh
 |
| git revision | master / 70a8deb |
| ant | version: Apache Ant(TM) version 1.9.6 compiled on July 20 2018 |
| Default Java | LTS |
| unit | 
https://builds.apache.org/job/PreCommit-SOLR-Build/515/artifact/out/patch-unit-solr_contrib_extraction.txt
 |
|  Test Results | 
https://builds.apache.org/job/PreCommit-SOLR-Build/515/testReport/ |
| modules | C: solr/contrib/dataimporthandler solr/contrib/extraction 
solr/contrib/ltr solr/contrib/velocity solr/core solr/solrj solr/test-framework 
U: solr |
| Console output | 
https://builds.apache.org/job/PreCommit-SOLR-Build/515/console |
| Powered by | Apache Yetus 0.7.0   http://yetus.apache.org |


This message was automatically generated.



> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Components: Tests
>Affects Versions: 8.0
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.patch, 
> SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException 

[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2019-07-29 Thread Munendra S N (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16895469#comment-16895469
 ] 

Munendra S N commented on SOLR-12555:
-

 [^SOLR-12555.patch] 
Patch with only solr changes. I'm planning to commit this module by module if 
there are many changes.

[~gerlowskija] any suggestions here?? 

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Components: Tests
>Affects Versions: 8.0
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.patch, 
> SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2019-07-28 Thread Munendra S N (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16894935#comment-16894935
 ] 

Munendra S N commented on SOLR-12555:
-

I have created separate lucene issue - LUCENE-8938

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Components: Tests
>Affects Versions: 8.0
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2019-07-28 Thread Lucene/Solr QA (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16894787#comment-16894787
 ] 

Lucene/Solr QA commented on SOLR-12555:
---

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 113 new or modified 
test files. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  5m 
59s{color} | {color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  5m 
59s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  5m 
59s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Release audit (RAT) {color} | 
{color:green}  2m  4s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Check forbidden APIs {color} | 
{color:green}  0m 37s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Validate source patterns {color} | 
{color:green}  0m 37s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  3m 
58s{color} | {color:green} common in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green} 16m  
5s{color} | {color:green} core in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
40s{color} | {color:green} join in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
28s{color} | {color:green} queryparser in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
30s{color} | {color:green} replicator in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  2m 
37s{color} | {color:green} sandbox in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  1m 
25s{color} | {color:green} suggest in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  3m  
7s{color} | {color:green} test-framework in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
59s{color} | {color:green} dataimporthandler in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
35s{color} | {color:green} extraction in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  1m  
2s{color} | {color:green} ltr in the patch passed. {color} |
| {color:red}-1{color} | {color:red} unit {color} | {color:red}  0m 22s{color} 
| {color:red} velocity in the patch failed. {color} |
| {color:red}-1{color} | {color:red} unit {color} | {color:red} 30m 57s{color} 
| {color:red} core in the patch failed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  5m 
17s{color} | {color:green} solrj in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
30s{color} | {color:green} test-framework in the patch passed. {color} |
| {color:black}{color} | {color:black} {color} | {color:black} 86m 14s{color} | 
{color:black} {color} |
\\
\\
|| Reason || Tests ||
| Failed junit tests | solr.search.facet.TestCloudJSONFacetSKG |
\\
\\
|| Subsystem || Report/Notes ||
| JIRA Issue | SOLR-12555 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/12976063/SOLR-12555.patch |
| Optional Tests |  compile  javac  unit  ratsources  checkforbiddenapis  
validatesourcepatterns  |
| uname | Linux lucene1-us-west 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 
10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | ant |
| Personality | 
/home/jenkins/jenkins-slave/workspace/PreCommit-SOLR-Build/sourcedir/dev-tools/test-patch/lucene-solr-yetus-personality.sh
 |
| git revision | master / 8c8d8abddc |
| ant | version: Apache Ant(TM) version 1.10.5 compiled on March 28 2019 |
| Default Java | LTS |
| unit | 
https://builds.apache.org/job/PreCommit-SOLR-Build/512/artifact/out/patch-unit-solr_contrib_velocity.txt
 |
| unit | 
https://builds.apache.org/job/PreCommit-SOLR-Build/512/artifact/out/patch-unit-solr_core.txt
 |
|  Test Results | 
https://builds.apache.org/job/PreCommit-SOLR-Build/512/testReport/ |
| modules | C: lucene/analysis/common lucene/core lucene/join 
lucene/queryparser lucene/replicator lucene/sandbox 

[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2019-07-28 Thread Munendra S N (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16894659#comment-16894659
 ] 

Munendra S N commented on SOLR-12555:
-

 [^SOLR-12555.patch] 
Fixed the failing test in {{ChangedSchemaMergeTest}}

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Components: Tests
>Affects Versions: 8.0
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2019-07-27 Thread Lucene/Solr QA (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16894520#comment-16894520
 ] 

Lucene/Solr QA commented on SOLR-12555:
---

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 113 new or modified 
test files. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  6m 
12s{color} | {color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  7m 
31s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  7m 
31s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Release audit (RAT) {color} | 
{color:green}  3m 32s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Check forbidden APIs {color} | 
{color:green}  1m 25s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Validate source patterns {color} | 
{color:green}  1m 25s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  8m 
26s{color} | {color:green} common in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green} 29m 
57s{color} | {color:green} core in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
38s{color} | {color:green} join in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
22s{color} | {color:green} queryparser in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  1m 
15s{color} | {color:green} replicator in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  4m 
11s{color} | {color:green} sandbox in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  3m 
16s{color} | {color:green} suggest in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  4m 
16s{color} | {color:green} test-framework in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  1m 
13s{color} | {color:green} dataimporthandler in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
22s{color} | {color:green} extraction in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  2m  
9s{color} | {color:green} ltr in the patch passed. {color} |
| {color:red}-1{color} | {color:red} unit {color} | {color:red}  0m 42s{color} 
| {color:red} velocity in the patch failed. {color} |
| {color:red}-1{color} | {color:red} unit {color} | {color:red} 50m 16s{color} 
| {color:red} core in the patch failed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  7m 
22s{color} | {color:green} solrj in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
24s{color} | {color:green} test-framework in the patch passed. {color} |
| {color:black}{color} | {color:black} {color} | {color:black}135m 36s{color} | 
{color:black} {color} |
\\
\\
|| Reason || Tests ||
| Failed junit tests | solr.schema.ChangedSchemaMergeTest |
|   | solr.search.facet.TestCloudJSONFacetSKG |
|   | solr.security.AuditLoggerIntegrationTest |
\\
\\
|| Subsystem || Report/Notes ||
| JIRA Issue | SOLR-12555 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/12976027/SOLR-12555.patch |
| Optional Tests |  compile  javac  unit  ratsources  checkforbiddenapis  
validatesourcepatterns  |
| uname | Linux lucene2-us-west.apache.org 4.4.0-112-generic #135-Ubuntu SMP 
Fri Jan 19 11:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | ant |
| Personality | 
/home/jenkins/jenkins-slave/workspace/PreCommit-SOLR-Build/sourcedir/dev-tools/test-patch/lucene-solr-yetus-personality.sh
 |
| git revision | master / 4050ddc |
| ant | version: Apache Ant(TM) version 1.9.6 compiled on July 20 2018 |
| Default Java | LTS |
| unit | 
https://builds.apache.org/job/PreCommit-SOLR-Build/509/artifact/out/patch-unit-solr_contrib_velocity.txt
 |
| unit | 
https://builds.apache.org/job/PreCommit-SOLR-Build/509/artifact/out/patch-unit-solr_core.txt
 |
|  Test Results | 
https://builds.apache.org/job/PreCommit-SOLR-Build/509/testReport/ |
| modules | C: 

[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2019-07-26 Thread Munendra S N (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16894275#comment-16894275
 ] 

Munendra S N commented on SOLR-12555:
-

 [^SOLR-12555.patch] 
For all other packages

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Components: Tests
>Affects Versions: 8.0
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.patch, SOLR-12555.patch, SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-12-03 Thread Jason Gerlowski (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16708138#comment-16708138
 ] 

Jason Gerlowski commented on SOLR-12555:


Thanks for review Bar.  I committed the resulting patch this past weekend.  
Will post here if I'm able to bite off a few more packages this week.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.patch, SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-12-01 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16706030#comment-16706030
 ] 

ASF subversion and git services commented on SOLR-12555:


Commit 2410b624372a8ece42aa972aa11c9eebeaf7cb96 in lucene-solr's branch 
refs/heads/branch_7x from [~gerlowskija]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2410b62 ]

SOLR-12555: Use `expectThrows` for expected exceptions

This commit replaces the `try { doX(); fail(); }` pattern with the
`expectThrows` test helper, which was created for this purpose.

This commit makes these changes in the core package:
`o.a.solr.core`.


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.patch, SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-12-01 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16706026#comment-16706026
 ] 

ASF subversion and git services commented on SOLR-12555:


Commit 6e4c9b3b58148a48f582095a5a51aca2a63d0d35 in lucene-solr's branch 
refs/heads/master from [~gerlowskija]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6e4c9b3 ]

SOLR-12555: Use `expectThrows` for expected exceptions

This commit replaces the `try { doX(); fail(); }` pattern with the
`expectThrows` test helper, which was created for this purpose.

This commit makes these changes in the core package:
`o.a.solr.core`.


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.patch, SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-11-20 Thread Bar Rotstein (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16693658#comment-16693658
 ] 

Bar Rotstein commented on SOLR-12555:
-

You've done this very quickly I feel like we are getting closer to closing this 
ticket.
Great patch, except for two really minor inputs I have.

1. I'd change SolrResourceLoader#testWrongEncoding:142 from

{code:java}SolrResourceLoader loader = new 
SolrResourceLoader(TEST_PATH().resolve("collection1"));
// ensure we get our exception
SolrException thrown = expectThrows(SolrException.class, () -> 
loader.getLines(wrongEncoding));
assertTrue(thrown.getCause() instanceof CharacterCodingException);
loader.close();{code}
  to {code:java}try(SolrResourceLoader loader = new 
SolrResourceLoader(TEST_PATH().resolve("collection1"))) {
  // ensure we get our exception
  SolrException thrown = expectThrows(SolrException.class, () -> 
loader.getLines(wrongEncoding));
  assertTrue(thrown.getCause() instanceof CharacterCodingException);
}{code}

2. Missing assertThat in TestCoreDiscovery#testSolrHomeNotReadable:530
{code:java}Exception thrown = expectThrows(Exception.class, () -> {
  CoreContainer cc = null;
  try { cc = init(); }
  finally { if (cc != null) cc.shutdown(); }
});
assertThat(thrown.getMessage(), containsString("Error reading core root 
directory"));{code}

Other than these two minor differences, I edited out a few blank lines.
Hopefully we can keep up the pace.
I'll upload a with these changes.


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-11-20 Thread Bar Rotstein (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16693621#comment-16693621
 ] 

Bar Rotstein commented on SOLR-12555:
-

Sure thing, I'll check it out ASAP.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.patch, 
> SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-11-16 Thread Jason Gerlowski (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16689620#comment-16689620
 ] 

Jason Gerlowski commented on SOLR-12555:


I plan on picking up some of the tests in 
`./solr/core/src/test/org/apache/solr/core` this weekend if I get a chance.  
Maybe some others, but we'll see how much time I get.  Just a heads up Bar in 
case you'd gotten time to start on something.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-11-09 Thread Jason Gerlowski (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16681814#comment-16681814
 ] 

Jason Gerlowski commented on SOLR-12555:


I don't have anything inflight at the moment, so go ahead.  If that changes 
though I'll be sure to post here and tag you.  Thanks for the continued help 
with this; really appreciate the effort.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-11-09 Thread Bar Rotstein (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16681605#comment-16681605
 ] 

Bar Rotstein commented on SOLR-12555:
-

[~gerlowskija], do you have any packages that you've started working on?
I'd like to tackle a few if I'll have some free time this coming week,
and wouldn't want to accidentally have a collision.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-11-05 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16674968#comment-16674968
 ] 

ASF subversion and git services commented on SOLR-12555:


Commit f669a1fb0e1ff974df93229c41cd397956cb1e9a in lucene-solr's branch 
refs/heads/jira/http2 from [~gerlowskija]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=f669a1f ]

SOLR-12555: Use `expectThrows` for expected exceptions

This commit replaces the `try { doX(); fail(); }` pattern with the
`expectThrows` test helper, which was created for this purpose.

This commit makes these changes in the core package: `o.a.solr.search`.

Closes #464


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-11-03 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16674069#comment-16674069
 ] 

ASF subversion and git services commented on SOLR-12555:


Commit f669a1fb0e1ff974df93229c41cd397956cb1e9a in lucene-solr's branch 
refs/heads/master from [~gerlowskija]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=f669a1f ]

SOLR-12555: Use `expectThrows` for expected exceptions

This commit replaces the `try { doX(); fail(); }` pattern with the
`expectThrows` test helper, which was created for this purpose.

This commit makes these changes in the core package: `o.a.solr.search`.

Closes #464


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 4h
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-10-08 Thread Jason Gerlowski (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1664#comment-1664
 ] 

Jason Gerlowski commented on SOLR-12555:


Thanks Bar, I'll take a look and put any comments on the PR.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-10-07 Thread Bar Rotstein (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16641176#comment-16641176
 ] 

Bar Rotstein commented on SOLR-12555:
-

Just filed a new pull request for the tests in package org.apache.solr.search.
 The tests in the package's sub packages were not refactored.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-08-10 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16576000#comment-16576000
 ] 

ASF subversion and git services commented on SOLR-12555:


Commit 00aeb64c10290780256476de2266a9bb600c336d in lucene-solr's branch 
refs/heads/jira/http2 from [~gerlowskija]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=00aeb64 ]

SOLR-12555: Use `expectThrows` for expected exceptions

This commit replaces the `try { doX(); fail(); }` pattern with the
`expectThrows` test helper, which was created for this purpose.  This
commit makes these changes in the core package: `o.a.solr.cloud`.

Closes #425


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-08-09 Thread Jason Gerlowski (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16575336#comment-16575336
 ] 

Jason Gerlowski commented on SOLR-12555:


Hey Bar,

My apologies for the delay, but I've committed the first batch of test changes 
you prepared.  I'll be keeping an eye on Jenkins runs for the next week or so 
to make sure we don't inadvertently cause any issues.  If nothing crops up, 
I'll be ready to commit another batch next week.  If you're still interested in 
helping move this Jira along, let me know what test files you'll target next.  
I'm going to start preparing a batch from the other end of the list, and will 
do the ~30 packages that have 1 test to change.

'

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-08-09 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16575326#comment-16575326
 ] 

ASF subversion and git services commented on SOLR-12555:


Commit 00aeb64c10290780256476de2266a9bb600c336d in lucene-solr's branch 
refs/heads/master from [~gerlowskija]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=00aeb64 ]

SOLR-12555: Use `expectThrows` for expected exceptions

This commit replaces the `try { doX(); fail(); }` pattern with the
`expectThrows` test helper, which was created for this purpose.  This
commit makes these changes in the core package: `o.a.solr.cloud`.

Closes #425


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-07-25 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16555362#comment-16555362
 ] 

ASF subversion and git services commented on SOLR-12555:


Commit 6ed9607f74398d054e1cda7d1c02da80c2d93180 in lucene-solr's branch 
refs/heads/jira/http2 from [~gerlowskija]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6ed9607 ]

SOLR-12555: Add add'l expectThrows() test helper


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-07-23 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16553634#comment-16553634
 ] 

ASF subversion and git services commented on SOLR-12555:


Commit 6ed9607f74398d054e1cda7d1c02da80c2d93180 in lucene-solr's branch 
refs/heads/master from [~gerlowskija]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6ed9607 ]

SOLR-12555: Add add'l expectThrows() test helper


> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-07-22 Thread Bar Rotstein (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16552259#comment-16552259
 ] 

Bar Rotstein commented on SOLR-12555:
-

Status report:

solr/core/src/test/org/apache/solr/cloud

    •    ./solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java -> Done
    •    ./solr/core/src/test/org/apache/solr/cloud/OverseerStatusTest.java -> 
Done
    •    
./solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java -> 
Done
    •    
./solr/core/src/test/org/apache/solr/cloud/TestDownShardTolerantSearch.java -> 
Done
    •    ./solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java -> Done
    •    
./solr/core/src/test/org/apache/solr/cloud/TestPullReplicaErrorHandling.java -> 
Done
    •    ./solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java 
-> Done
    •    ./solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java 
-> Done
    •    
./solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java
 -> Done
    •    
./solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithSecureImpersonation.java
 -> Done
    •    ./solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java -> 
Done
    •    ./solr/core/src/test/org/apache/solr/cloud/SolrXmlInZkTest.java -> Done
    •    ./solr/core/src/test/org/apache/solr/cloud/TestZkChroot.java -> Done
    •    ./solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java -> 
Done
    •    ./solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java -> Done
    •    
./solr/core/src/test/org/apache/solr/cloud/LeaderFailureAfterFreshStartTest.java
 -> Done(None)
    •    
./solr/core/src/test/org/apache/solr/cloud/TestLeaderInitiatedRecoveryThread.java
 -> Done
    •    
./solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithDelegationTokens.java
 -> Done
    •    ./solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java 
-> Done 
    •    
./solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java -> 
Done 
    •    ./solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java -> 
Done
    •    ./solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java 
-> Done
    •    
./solr/core/src/test/org/apache/solr/cloud/CollectionsAPISolrJTest.java -> Done
    •    
./solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java > Done

solr/core/src/test/org/apache/solr

    •    solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java -> Done
    •    solr/core/src/test/org/apache/solr/TestCursorMarkWithoutUniqueKey.java 
-> Done
    •    solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java -> Done
    •    solr/core/src/test/org/apache/solr/TestDistributedSearch.java -> Done
    •    solr/core/src/test/org/apache/solr/TestTolerantSearch.java -> Done

I have just pushed a commit and opened a pull request.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-07-19 Thread Bar Rotstein (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16549599#comment-16549599
 ] 

Bar Rotstein commented on SOLR-12555:
-

{quote}Pick any packages you'd like out of that list and post them here when 
you're able to start working on them.{quote}
I have just started hacking away, working on the tests inside the 
*/solr/core/src/test/org/apache/solr/cloud* package.
Hopefully I will be able to cover them all pretty soon.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-07-19 Thread Jason Gerlowski (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16549242#comment-16549242
 ] 

Jason Gerlowski commented on SOLR-12555:


That'd be great, thanks for volunteering to help [~barrotsteindev].

Pick any packages you'd like out of that list and post them here when you're 
able to start working on them.  (I attached a file above with the number of 
tests per package, if that helps.)  I'll do the same when I'm able to start in 
on this myself (probably not till this weekend).  I really don't think these 
changes are particularly dangerous, but as flaky as Solr's tests are at the 
moment, I was thinking we could break this into smaller commits that I'll make 
with some time in between, so that it's easier to catch any test failures we 
might introduce.  We could aim to change around 30 tests in each commit.  (If 
you're up for doing more than that though, feel free.  I can always break 
things into chunks on my end before committing.)

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-07-18 Thread Bar Rotstein (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16548544#comment-16548544
 ] 

Bar Rotstein commented on SOLR-12555:
-

I don't mind working on this too if you need help, perhaps we can split the 
work to different packages, and each would work on designated packages, if 
that's fine by you.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555.txt
>
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-12555) Replace try-fail-catch test patterns

2018-07-18 Thread Jason Gerlowski (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16548267#comment-16548267
 ] 

Jason Gerlowski commented on SOLR-12555:


 [^SOLR-12555.txt] Attaching a file with all the instances of this I could find 
with some simple grep.  There's a lot more of it than I anticipated.  Will 
probably have to get to this in a piece-meal fashion when I get the time.

> Replace try-fail-catch test patterns
> 
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
>  Issue Type: Test
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Tests
>Affects Versions: master (8.0)
>Reporter: Jason Gerlowski
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12555.txt
>
>
> I recently added some test code through SOLR-12427 which used the following 
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the 
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense.  Many 
> of them were written before {{expectThrows}} was introduced, and having the 
> old style assertions around makes it easier for them to continue creeping in.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org