-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse the reversed error message #6290 #6368
Reverse the reversed error message #6290 #6368
Conversation
Shows list of files not found first before listing the directories searched. At the same time I referenced the constant for RESOURCES_FRONTEND_DEFAULT instead of hard-coding that path. Added two new test cases to cover single- and multi-file exception messages.
michaelwmerritt seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r1.
Reviewable status: 9 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @MichaelWMerritt)
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 57 at r1 (raw file):
import static com.vaadin.flow.server.frontend.FrontendUtils.NODE_MODULES; import static com.vaadin.flow.server.frontend.FrontendUtils.WEBPACK_PREFIX_ALIAS; import static org.junit.Assert.*;
We don't use import all from package. If you could revert this import change.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 169 at r1 (raw file):
atLeastOneRemoved
Should be fileRemoved as we only remove one file.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 170 at r1 (raw file):
Mockito.when(logger.isInfoEnabled()).thenReturn(true); boolean atLeastOneRemoved = false; for (String imprt : getExpectedImports()) {
Do we need to loop the imports to remove a known file?
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 172 at r1 (raw file):
Assert.assertTrue(resolveImportFile(frontendDirectory, frontendDirectory, imprt).delete());
Could have a message on why it failed as else it will just read as expected true got false which makes it hard to see why the test failed also a message will make figuring the test out faster than without.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 177 at r1 (raw file):
} } Assert.assertTrue(atLeastOneRemoved);
Should also have a failure message informing what we expected to be true.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 185 at r1 (raw file):
illegalStateException = e; } assertNotNull(illegalStateException);
this assert should be inside the try as Assert.fail("Execute should have failed with missing files");
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 187 at r1 (raw file):
assertNotNull(illegalStateException); assertThat(illegalStateException.getCause().getMessage(),
this assert could be in the catch block.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 196 at r1 (raw file):
Mockito.when(logger.isInfoEnabled()).thenReturn(true); boolean atLeastOneRemoved = false; for (String imprt : getExpectedImports()) {
Do we need to loop the imports to remove two known files?
If they don't exist we will fail the assert, else we will succeed and a file will have been removed.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 205 at r1 (raw file):
Assert.assertTrue(atLeastOneRemoved); IllegalStateException illegalStateException = null;
same as above, assertThat inside the catch block and a Assert.fail after updater.execute() instead of saving the exception and checking it twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r1.
Reviewable status: 9 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @MichaelWMerritt)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 9 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @caalador)
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 57 at r1 (raw file):
Previously, caalador wrote…
We don't use import all from package. If you could revert this import change.
Done.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 169 at r1 (raw file):
Previously, caalador wrote…
atLeastOneRemoved
Should be fileRemoved as we only remove one file.
I removed this boolean altogether as it is no longer needed with your other suggestion of not needing to iterate through the list of files in order to delete the known filename.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 170 at r1 (raw file):
Previously, caalador wrote…
Do we need to loop the imports to remove a known file?
Removed loop and am instead directly deleting the file based on name.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 172 at r1 (raw file):
Previously, caalador wrote…
Assert.assertTrue(resolveImportFile(frontendDirectory, frontendDirectory, imprt).delete());
Could have a message on why it failed as else it will just read as expected true got false which makes it hard to see why the test failed also a message will make figuring the test out faster than without.
Done.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 177 at r1 (raw file):
Previously, caalador wrote…
Should also have a failure message informing what we expected to be true.
Done.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 185 at r1 (raw file):
Previously, caalador wrote…
this assert should be inside the try as
Assert.fail("Execute should have failed with missing files");
Done.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 187 at r1 (raw file):
Previously, caalador wrote…
this assert could be in the catch block.
Done.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 196 at r1 (raw file):
Previously, caalador wrote…
Do we need to loop the imports to remove two known files?
If they don't exist we will fail the assert, else we will succeed and a file will have been removed.
Done.
flow-server/src/test/java/com/vaadin/flow/server/frontend/NodeUpdateImportsTest.java, line 205 at r1 (raw file):
Previously, caalador wrote…
same as above, assertThat inside the catch block and a Assert.fail after updater.execute() instead of saving the exception and checking it twice.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix.
Reviewed 1 of 1 files at r2.
Reviewable status: complete! all discussions resolved, 1 of 1 LGTMs obtained
Shows list of files not found first before listing the directories searched. At the same time I referenced the constant for RESOURCES_FRONTEND_DEFAULT instead of hard-coding that path. Added two new test cases to cover single- and multi-file exception messages. Fixes #6290
Shows list of files not found first before listing the directories searched. At the same time I referenced the constant for RESOURCES_FRONTEND_DEFAULT instead of hard-coding that path. Added two new test cases to cover single- and multi-file exception messages. Fixes #6290
* Check webpack config and build-info depending on compatibility mode (#6343) Fixes #6233 * Reverse the reversed error message #6290 (#6368) Shows list of files not found first before listing the directories searched. At the same time I referenced the constant for RESOURCES_FRONTEND_DEFAULT instead of hard-coding that path. Added two new test cases to cover single- and multi-file exception messages. Fixes #6290 * Consider folders in the classpath when copying resources (#6246) (#6379) #6306 * Update RoutePrefix to fix Javadoc typo (#6350) * Update RoutePrefix to fix JavaDoc typo * Update Route to fix Javadoc typo * Preserve JavaScript annotations order (#6371) * Preserve JavaScript annotations order Fixes #6198 * Improve test code * Revert method rename and visibility modification to maintain API compatibility
Shows list of files not found first before listing the directories searched. At the same time I referenced the constant for RESOURCES_FRONTEND_DEFAULT instead of hard-coding that path. Added two new test cases to cover single- and multi-file exception messages. Fixes #6290
Shows list of files not found first before listing the directories searched. At the same time I referenced the constant for RESOURCES_FRONTEND_DEFAULT instead of hard-coding that path. Added two new test cases to cover single- and multi-file exception messages. Fixes #6290
Reverse the reversed error message #6290
Shows list of files not found first before listing the directories searched.
At the same time I referenced the constant for RESOURCES_FRONTEND_DEFAULT
instead of hard-coding that path.
Added two new test cases to cover single- and multi-file exception messages.
This change is