|
|
@ -6,7 +6,7 @@ import java.io.File;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import org.gcube.common.scope.api.ScopeProvider;
|
|
|
|
import org.gcube.common.scope.api.ScopeProvider;
|
|
|
|
import org.gcube.contentmanagement.blobstorage.resource.RequestObject;
|
|
|
|
import org.gcube.contentmanagement.blobstorage.resource.MyFile;
|
|
|
|
import org.gcube.contentmanagement.blobstorage.resource.StorageObject;
|
|
|
|
import org.gcube.contentmanagement.blobstorage.resource.StorageObject;
|
|
|
|
import org.gcube.contentmanagement.blobstorage.service.IClient;
|
|
|
|
import org.gcube.contentmanagement.blobstorage.service.IClient;
|
|
|
|
import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendException;
|
|
|
|
import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendException;
|
|
|
@ -53,12 +53,12 @@ public class PropertiesTest {
|
|
|
|
public void getPropertyByPath() throws RemoteBackendException {
|
|
|
|
public void getPropertyByPath() throws RemoteBackendException {
|
|
|
|
String valueFound= client.getMetaInfo(field).RFile(remotePath);
|
|
|
|
String valueFound= client.getMetaInfo(field).RFile(remotePath);
|
|
|
|
System.out.println("value found for property: "+field+" is "+valueFound);
|
|
|
|
System.out.println("value found for property: "+field+" is "+valueFound);
|
|
|
|
RequestObject f= client.getMetaFile().RFile(remotePath);
|
|
|
|
MyFile f= client.getMetaFile().RFile(remotePath);
|
|
|
|
assertNotNull(f);
|
|
|
|
assertNotNull(f);
|
|
|
|
print(f);
|
|
|
|
print(f);
|
|
|
|
String result= client.setMetaInfo(field, value).RFile(remotePath);
|
|
|
|
String result= client.setMetaInfo(field, value).RFile(remotePath);
|
|
|
|
System.out.println("new property set ");
|
|
|
|
System.out.println("new property set ");
|
|
|
|
RequestObject f1= client.getMetaFile().RFile(remotePath);
|
|
|
|
MyFile f1= client.getMetaFile().RFile(remotePath);
|
|
|
|
print(f1);
|
|
|
|
print(f1);
|
|
|
|
assertNotNull(f1);
|
|
|
|
assertNotNull(f1);
|
|
|
|
assertEquals(f1.getMimeType(), value);
|
|
|
|
assertEquals(f1.getMimeType(), value);
|
|
|
@ -70,12 +70,12 @@ public class PropertiesTest {
|
|
|
|
public void getPropertyById() throws RemoteBackendException {
|
|
|
|
public void getPropertyById() throws RemoteBackendException {
|
|
|
|
String valueFound= client.getMetaInfo(field).RFile(id);
|
|
|
|
String valueFound= client.getMetaInfo(field).RFile(id);
|
|
|
|
System.out.println("value found for property: "+field+" is "+valueFound);
|
|
|
|
System.out.println("value found for property: "+field+" is "+valueFound);
|
|
|
|
RequestObject f= client.getMetaFile().RFile(id);
|
|
|
|
MyFile f= client.getMetaFile().RFile(id);
|
|
|
|
assertNotNull(f);
|
|
|
|
assertNotNull(f);
|
|
|
|
print(f);
|
|
|
|
print(f);
|
|
|
|
String result= client.setMetaInfo(field, value).RFile(id);
|
|
|
|
String result= client.setMetaInfo(field, value).RFile(id);
|
|
|
|
System.out.println("new property set ");
|
|
|
|
System.out.println("new property set ");
|
|
|
|
RequestObject f1= client.getMetaFile().RFile(id);
|
|
|
|
MyFile f1= client.getMetaFile().RFile(id);
|
|
|
|
print(f1);
|
|
|
|
print(f1);
|
|
|
|
assertNotNull(f1);
|
|
|
|
assertNotNull(f1);
|
|
|
|
assertEquals(f1.getMimeType(), value);
|
|
|
|
assertEquals(f1.getMimeType(), value);
|
|
|
@ -85,7 +85,7 @@ public class PropertiesTest {
|
|
|
|
// @Test
|
|
|
|
// @Test
|
|
|
|
public void setProperty() throws RemoteBackendException {
|
|
|
|
public void setProperty() throws RemoteBackendException {
|
|
|
|
String result= client.setMetaInfo(field, value).RFile(id);
|
|
|
|
String result= client.setMetaInfo(field, value).RFile(id);
|
|
|
|
RequestObject f= client.getMetaFile().RFile(remotePath);
|
|
|
|
MyFile f= client.getMetaFile().RFile(remotePath);
|
|
|
|
assertNotNull(f);
|
|
|
|
assertNotNull(f);
|
|
|
|
print(f);
|
|
|
|
print(f);
|
|
|
|
|
|
|
|
|
|
|
@ -99,7 +99,7 @@ public class PropertiesTest {
|
|
|
|
removeLocalFile();
|
|
|
|
removeLocalFile();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void print(RequestObject f) {
|
|
|
|
private void print(MyFile f) {
|
|
|
|
System.out.println("\t name "+f.getName());
|
|
|
|
System.out.println("\t name "+f.getName());
|
|
|
|
System.out.println("\t size "+f.getSize());
|
|
|
|
System.out.println("\t size "+f.getSize());
|
|
|
|
System.out.println("\t owner "+f.getOwner());
|
|
|
|
System.out.println("\t owner "+f.getOwner());
|
|
|
|