JUnitTest updated
This commit is contained in:
parent
4e58624c4a
commit
59b841ba94
|
@ -6,24 +6,21 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.release=disabled
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
|
|
6
pom.xml
6
pom.xml
|
@ -65,6 +65,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
<version>1.7.30</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-codec</groupId>
|
<groupId>commons-codec</groupId>
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class DownloadsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
// @Test
|
||||||
public void getId(){
|
public void getId(){
|
||||||
String id= client.getId(encryptedId);
|
String id= client.getId(encryptedId);
|
||||||
System.out.println("id decrypted: "+id);
|
System.out.println("id decrypted: "+id);
|
||||||
|
|
|
@ -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.MyFile;
|
import org.gcube.contentmanagement.blobstorage.resource.RequestObject;
|
||||||
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 {
|
||||||
MyFile f= client.getMetaFile().RFile(remotePath);
|
RequestObject 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 {
|
||||||
MyFile f= client.getMetaFile().RFile(id);
|
RequestObject 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(MyFile f) {
|
private void print(RequestObject 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());
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class LockTest {
|
||||||
assertNotNull(id);
|
assertNotNull(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
// @Test
|
||||||
public void lockTest(){
|
public void lockTest(){
|
||||||
//download & lock
|
//download & lock
|
||||||
String idLock=client.lock().LFile(absoluteLocalPathDownload).RFile(remotePath);
|
String idLock=client.lock().LFile(absoluteLocalPathDownload).RFile(remotePath);
|
||||||
|
|
|
@ -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.MyFile;
|
import org.gcube.contentmanagement.blobstorage.resource.RequestObject;
|
||||||
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);
|
||||||
MyFile f= client.getMetaFile().RFile(remotePath);
|
RequestObject 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 ");
|
||||||
MyFile f1= client.getMetaFile().RFile(remotePath);
|
RequestObject 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);
|
||||||
MyFile f= client.getMetaFile().RFile(id);
|
RequestObject 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 ");
|
||||||
MyFile f1= client.getMetaFile().RFile(id);
|
RequestObject 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);
|
||||||
MyFile f= client.getMetaFile().RFile(remotePath);
|
RequestObject 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(MyFile f) {
|
private void print(RequestObject 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());
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 220 KiB After Width: | Height: | Size: 346 KiB |
Loading…
Reference in New Issue