-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Create DoraWorkerServiceHandlerTest.java #18059
Conversation
update Rename and exists tests for PagedDoraWorker.
|
||
@Override | ||
public void onCompleted() { | ||
// do nothing |
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.
remove the comment
@Override | ||
public void onCompleted() { | ||
// do nothing | ||
mResponses.sort(Comparator.comparing(MyStruct::getPath)); |
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.
sort in the test instead of sorting in this test observer
TestStreamObserver responseObserver = new TestStreamObserver(); | ||
mServiceHandler.listStatus(mRequest, responseObserver); | ||
List<MyStruct> responses = responseObserver.mResponses; | ||
String[] expectedPaths = new String[] {rootPath + "/d1", rootPath + "/d1/d1", |
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.
PathUtils.concatPath
TestStreamObserver finalResponseObserver = responseObserver; | ||
assertThrows(RuntimeException.class, () -> mServiceHandler.listStatus(mRequest, | ||
finalResponseObserver)); | ||
} |
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.
- list a file
- list a directory that does not exist
} | ||
|
||
@Test | ||
public void testListStatus() throws IOException { |
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.
also test InAlluxioPercentage
Automated checks report:
Some checks failed. Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks. |
Automated checks report:
All checks passed! |
} | ||
|
||
@Test | ||
public void testListStatus() throws IOException { |
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.
can you create different tests instead?
fos.close(); | ||
|
||
AlluxioURI oldPath = TEST_FILE_URI; | ||
for (int i = 1; i < 10; i++) { |
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.
we just need to test once
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.
LGTM
alluxio-bot, merge this please. |
What changes are proposed in this pull request?
I have created a test and create a liststatus test for its function.
Why are the changes needed?
Please clarify why the changes are needed. For instance,
add a unit test for DoraWorkerClientServiceHandler.
Does this PR introduce any user facing changes?
No.