move from RequestObject to MyFile in some test classes

v3.0.0
ROBERTO CIRILLO 3 years ago
parent 9c3bf60362
commit 81a3481faa

@ -6,7 +6,7 @@ import java.io.File;
import java.util.List;
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.service.IClient;
import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendException;
@ -53,7 +53,7 @@ public class GetMetaFileTest {
@Test
public void getMetaFileByPath() throws RemoteBackendException {
RequestObject f= client.getMetaFile().RFile(remotePath);
MyFile f= client.getMetaFile().RFile(remotePath);
// System.out.println("mime is: "+f.getMimeType());
client.put(true, "image/png").LFile("src/test/resources/dog.jpg").RFile(remotePath);
f= client.getMetaFile().RFile(remotePath);
@ -70,7 +70,7 @@ public class GetMetaFileTest {
@Test
public void getMetaFileById() throws RemoteBackendException {
RequestObject f= client.getMetaFile().RFile(id);
MyFile f= client.getMetaFile().RFile(id);
assertNotNull(f);
assertEquals(id, f.getId());
print(f);
@ -89,7 +89,7 @@ public class GetMetaFileTest {
assertTrue(list.isEmpty());
}
private void print(RequestObject f) {
private void print(MyFile f) {
System.out.println("\t name "+f.getName());
System.out.println("\t size "+f.getSize());
System.out.println("\t owner "+f.getOwner());

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

Loading…
Cancel
Save