move from RequestObject to MyFile in some test classes
This commit is contained in:
parent
9c3bf60362
commit
81a3481faa
|
@ -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,7 +53,7 @@ public class GetMetaFileTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMetaFileByPath() throws RemoteBackendException {
|
public void getMetaFileByPath() throws RemoteBackendException {
|
||||||
RequestObject f= client.getMetaFile().RFile(remotePath);
|
MyFile f= client.getMetaFile().RFile(remotePath);
|
||||||
// System.out.println("mime is: "+f.getMimeType());
|
// System.out.println("mime is: "+f.getMimeType());
|
||||||
client.put(true, "image/png").LFile("src/test/resources/dog.jpg").RFile(remotePath);
|
client.put(true, "image/png").LFile("src/test/resources/dog.jpg").RFile(remotePath);
|
||||||
f= client.getMetaFile().RFile(remotePath);
|
f= client.getMetaFile().RFile(remotePath);
|
||||||
|
@ -70,7 +70,7 @@ public class GetMetaFileTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMetaFileById() throws RemoteBackendException {
|
public void getMetaFileById() throws RemoteBackendException {
|
||||||
RequestObject f= client.getMetaFile().RFile(id);
|
MyFile f= client.getMetaFile().RFile(id);
|
||||||
assertNotNull(f);
|
assertNotNull(f);
|
||||||
assertEquals(id, f.getId());
|
assertEquals(id, f.getId());
|
||||||
print(f);
|
print(f);
|
||||||
|
@ -89,7 +89,7 @@ public class GetMetaFileTest {
|
||||||
assertTrue(list.isEmpty());
|
assertTrue(list.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
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());
|
||||||
|
|
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue