fix usermetadata check on OS X

Java on OS X does not support extended attributes, which the
filesystem blobstore uses to implement user metadata. This disable
the relevant test on OS X
This commit is contained in:
Ka-Hing Cheung 2015-01-19 14:01:11 -08:00 committed by Andrew Gaul
parent 24f9af7c68
commit 3cabb196ce
2 changed files with 16 additions and 1 deletions

View File

@ -17,6 +17,7 @@
package org.jclouds.filesystem.integration;
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
import org.jclouds.blobstore.domain.Blob;
@ -75,4 +76,14 @@ public class FilesystemBlobIntegrationTest extends BaseBlobIntegrationTest {
public void testCreateBlobWithExpiry() throws InterruptedException {
super.testCreateBlobWithExpiry();
}
/* Java on OS X does not support extended attributes, which the filesystem backend
* uses to implement user metadata */
@Override
protected void checkUserMetadata(Map<String, String> userMetadata1, Map<String, String> userMetadata2) {
if (!org.jclouds.utils.TestUtils.isMacOSX()) {
super.checkUserMetadata(userMetadata1, userMetadata2);
}
}
}

View File

@ -555,6 +555,10 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
testPut(payload, new ByteSourcePayload(byteSource), length, new PutOptions().multipart(true));
}
protected void checkUserMetadata(Map<String, String> userMetadata1, Map<String, String> userMetadata2) {
assertThat(userMetadata1).isEqualTo(userMetadata2);
}
private void testPut(Payload payload, Payload expectedPayload, long length, PutOptions options)
throws IOException, InterruptedException {
BlobStore blobStore = view.getBlobStore();
@ -581,7 +585,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
}
validateMetadata(blob.getMetadata(), container, blob.getMetadata().getName());
checkContentMetadata(blob);
assertThat(blob.getMetadata().getUserMetadata()).isEqualTo(userMetadata);
checkUserMetadata(blob.getMetadata().getUserMetadata(), userMetadata);
} finally {
returnContainer(container);
}