Skip to content

Commit

Permalink
tests: putObject: add functional test with multiple path segment obje…
Browse files Browse the repository at this point in the history
…ct name

Fixes #514
  • Loading branch information
balamurugana committed Jan 15, 2017
1 parent 711b2aa commit 65dcdf8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions functional/FunctionalTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ public static void putObject_test4() throws Exception {
}

/**
* Test: multipart: putObject(String bucketName, String objectName, String fileName, String contentType).
* Test: With content-type: putObject(String bucketName, String objectName, String fileName, String contentType).
*/
public static void putObject_test5() throws Exception {
System.out.println("Test: multipart: putObject(String bucketName, String objectName, String fileName,"
System.out.println("Test: putObject(String bucketName, String objectName, String fileName,"
+ " String contentType)");
String fileName = createFile(13 * MB);
client.putObject(bucketName, fileName, fileName, customContenType);
Expand All @@ -231,6 +231,20 @@ public static void putObject_test5() throws Exception {
client.removeObject(bucketName, fileName);
}

/**
* Test: putObject(String bucketName, String objectName, String fileName).
* where objectName has multiple path segments.
*/
public static void putObject_test6() throws Exception {
System.out.println("Test: objectName with path segments: " +
"putObject(String bucketName, String objectName, String fileName)");
String fileName = createFile(3 * MB);
String objectName = "path/to/" + fileName;
client.putObject(bucketName, objectName, fileName);
Files.delete(Paths.get(fileName));
client.removeObject(bucketName, objectName);
}

/**
* Test: statObject(String bucketName, String objectName).
*/
Expand Down Expand Up @@ -876,6 +890,7 @@ public static void main(String[] args) {
putObject_test3();
putObject_test4();
putObject_test5();
putObject_test6();

statObject_test();

Expand Down

0 comments on commit 65dcdf8

Please sign in to comment.