Skip to content

Commit 81f90c2

Browse files
committed
Check for sibling directory cases in BulkTests
1 parent 9d3ec91 commit 81f90c2

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/BindingsTests.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,6 +2485,7 @@ void overwriteTrue() {
24852485
class BulkPost {
24862486
private int workspaceId;
24872487
private int otherWorkspaceId;
2488+
private final Path destinationPath = Path.of("./destination_dir");
24882489

24892490
@BeforeEach
24902491
void beforeEach() throws IOException {
@@ -2502,9 +2503,11 @@ void beforeEach() throws IOException {
25022503
new BulkPutItem.FileBulkPutItem("top_dir/sub_file.txt", "file within a directory"),
25032504
new BulkPutItem.FileBulkPutItem("other_dir/other_file.txt", "another file within a directory"),
25042505
new BulkPutItem.FileBulkPutItem("top_dir/nested_dir/nested_file.txt", "file within a nested directory"),
2505-
new BulkPutItem.DirectoryBulkPutItem("destination_dir")
2506+
new BulkPutItem.DirectoryBulkPutItem("destination_dir"),
2507+
new BulkPutItem.DirectoryBulkPutItem("destination")
25062508
);
25072509
wsServer.bulkPut(ownerToken, workspaceId, wsContents);
2510+
wsServer.bulkPut(ownerToken, otherWorkspaceId, List.of(new BulkPutItem.DirectoryBulkPutItem("destination_dir")));
25082511
}
25092512

25102513
@AfterEach
@@ -2524,7 +2527,6 @@ void afterEach() throws IOException {
25242527
@ParameterizedTest
25252528
@MethodSource("bulkPostBasicCasesArgs")
25262529
void bulkMoveSameWorkspaceBasicCases(List<Path> inputs) {
2527-
final var destinationPath = Path.of("./destination_dir");
25282530
final var resp = wsServer.bulkMove(
25292531
ownerToken,
25302532
workspaceId,
@@ -2575,7 +2577,6 @@ void bulkMoveSameWorkspaceBasicCases(List<Path> inputs) {
25752577
@ParameterizedTest
25762578
@MethodSource("bulkPostBasicCasesArgs")
25772579
void bulkMoveBtwnWorkspaceBasicCases(List<Path> inputs) {
2578-
final var destinationPath = Path.of(".");
25792580
final var resp = wsServer.bulkMove(
25802581
ownerToken,
25812582
workspaceId,
@@ -2626,7 +2627,6 @@ void bulkMoveBtwnWorkspaceBasicCases(List<Path> inputs) {
26262627
@ParameterizedTest
26272628
@MethodSource("bulkPostBasicCasesArgs")
26282629
void bulkCopySameWorkspaceBasicCases(List<Path> inputs) {
2629-
final var destinationPath = Path.of("./destination_dir");
26302630
final var resp = wsServer.bulkCopy(
26312631
ownerToken,
26322632
workspaceId,
@@ -2679,7 +2679,6 @@ void bulkCopySameWorkspaceBasicCases(List<Path> inputs) {
26792679
@ParameterizedTest
26802680
@MethodSource("bulkPostBasicCasesArgs")
26812681
void bulkCopyBtwnWorkspaceBasicCases(List<Path> inputs) {
2682-
final var destinationPath = Path.of(".");
26832682
final var resp = wsServer.bulkCopy(
26842683
ownerToken,
26852684
workspaceId,
@@ -2729,6 +2728,7 @@ private static Stream<Arguments> bulkPostBasicCasesArgs() {
27292728
final var nestedFileInput = Path.of("other_dir/other_file.txt");
27302729
final var topDirInput = Path.of("top_dir");
27312730
final var nestedDirInput = Path.of("other_dir/nested_dir");
2731+
final var siblingNameInput = Path.of("destination");
27322732

27332733
return Stream.of(
27342734
Arguments.arguments(named("Top Level File Single Bulk POST", List.of(topFileInput))),
@@ -2739,7 +2739,8 @@ private static Stream<Arguments> bulkPostBasicCasesArgs() {
27392739
Arguments.arguments(named("Multiple Directories Bulk POST", List.of(topDirInput, nestedDirInput))),
27402740
Arguments.arguments(named(
27412741
"Mixed Files and Directories Bulk POST",
2742-
List.of(topFileInput, nestedFileInput, nestedDirInput, topDirInput)))
2742+
List.of(topFileInput, nestedFileInput, nestedDirInput, topDirInput))),
2743+
Arguments.arguments(named("Sibling Directory with Subset Name", List.of(siblingNameInput)))
27432744
);
27442745
}
27452746

@@ -2855,7 +2856,7 @@ private record ConflictItem(Path originalPath, String originalContents, String c
28552856
/**
28562857
* Generate arguments to test basic upload cases.
28572858
*/
2858-
private static Stream<Arguments> bulkPostBasicCasesArgs() {
2859+
private static Stream<Arguments> overwriteCasesArgs() {
28592860
final var topFile = new ConflictItem(
28602861
Path.of("top_file.txt"),
28612862
"top level file",
@@ -2892,7 +2893,7 @@ private static Stream<Arguments> bulkPostBasicCasesArgs() {
28922893
* With overwrite unset, a conflict is returned. This tests for both within and between workspaces
28932894
*/
28942895
@ParameterizedTest
2895-
@MethodSource("bulkPostBasicCasesArgs")
2896+
@MethodSource("overwriteCasesArgs")
28962897
void bulkMoveOverwriteUnset(List<ConflictItem> inputs) {
28972898
final var paths = inputs.stream().map(i -> i.originalPath).toList();
28982899
final var destination = Path.of("./destination_dir");
@@ -2945,7 +2946,7 @@ void bulkMoveOverwriteUnset(List<ConflictItem> inputs) {
29452946
* With overwrite set to false, a conflict is returned. This tests for both within and between workspaces
29462947
*/
29472948
@ParameterizedTest
2948-
@MethodSource("bulkPostBasicCasesArgs")
2949+
@MethodSource("overwriteCasesArgs")
29492950
void bulkMoveOverwriteFalse(List<ConflictItem> inputs) {
29502951
final var paths = inputs.stream().map(i -> i.originalPath).toList();
29512952
final var destination = Path.of("./destination_dir");
@@ -2998,7 +2999,7 @@ void bulkMoveOverwriteFalse(List<ConflictItem> inputs) {
29982999
* With overwrite set to true, no conflict occurs. This tests for moving within a workspace
29993000
*/
30003001
@ParameterizedTest
3001-
@MethodSource("bulkPostBasicCasesArgs")
3002+
@MethodSource("overwriteCasesArgs")
30023003
void bulkMoveOverwriteTrueWithinWS(List<ConflictItem> inputs) {
30033004
final var paths = inputs.stream().map(i -> i.originalPath).toList();
30043005
final var destination = Path.of("./destination_dir");
@@ -3037,7 +3038,7 @@ void bulkMoveOverwriteTrueWithinWS(List<ConflictItem> inputs) {
30373038
* With overwrite set to true, no conflict occurs. This tests for moving between workspaces
30383039
*/
30393040
@ParameterizedTest
3040-
@MethodSource("bulkPostBasicCasesArgs")
3041+
@MethodSource("overwriteCasesArgs")
30413042
void bulkMoveOverwriteTrueBetweenWS(List<ConflictItem> inputs) {
30423043
final var paths = inputs.stream().map(i -> i.originalPath).toList();
30433044
final var destination = Path.of("./destination_dir");
@@ -3075,7 +3076,7 @@ void bulkMoveOverwriteTrueBetweenWS(List<ConflictItem> inputs) {
30753076
* With overwrite unset, a conflict is returned. This tests for both within and between workspaces
30763077
*/
30773078
@ParameterizedTest
3078-
@MethodSource("bulkPostBasicCasesArgs")
3079+
@MethodSource("overwriteCasesArgs")
30793080
void bulkCopyOverwriteUnset(List<ConflictItem> inputs) {
30803081
final var paths = inputs.stream().map(i -> i.originalPath).toList();
30813082
final var destination = Path.of("./destination_dir");
@@ -3128,7 +3129,7 @@ void bulkCopyOverwriteUnset(List<ConflictItem> inputs) {
31283129
* With overwrite set to false, a conflict is returned. This tests for both within and between workspaces
31293130
*/
31303131
@ParameterizedTest
3131-
@MethodSource("bulkPostBasicCasesArgs")
3132+
@MethodSource("overwriteCasesArgs")
31323133
void bulkCopyOverwriteFalse(List<ConflictItem> inputs) {
31333134
final var paths = inputs.stream().map(i -> i.originalPath).toList();
31343135
final var destination = Path.of("./destination_dir");
@@ -3181,7 +3182,7 @@ void bulkCopyOverwriteFalse(List<ConflictItem> inputs) {
31813182
* With overwrite set to true, no conflict occurs. This tests for moving within a workspace
31823183
*/
31833184
@ParameterizedTest
3184-
@MethodSource("bulkPostBasicCasesArgs")
3185+
@MethodSource("overwriteCasesArgs")
31853186
void bulkCopyOverwriteTrueWithinWS(List<ConflictItem> inputs) {
31863187
final var paths = inputs.stream().map(i -> i.originalPath).toList();
31873188
final var destination = Path.of("./destination_dir");
@@ -3220,7 +3221,7 @@ void bulkCopyOverwriteTrueWithinWS(List<ConflictItem> inputs) {
32203221
* With overwrite set to true, no conflict occurs. This tests for moving between workspaces
32213222
*/
32223223
@ParameterizedTest
3223-
@MethodSource("bulkPostBasicCasesArgs")
3224+
@MethodSource("overwriteCasesArgs")
32243225
void bulkCopyOverwriteTrueBetweenWS(List<ConflictItem> inputs) {
32253226
final var paths = inputs.stream().map(i -> i.originalPath).toList();
32263227
final var destination = Path.of("./destination_dir");

0 commit comments

Comments
 (0)