add new JUnitTest cases
This commit is contained in:
parent
76ee09b1be
commit
c50b3d6ba8
|
@ -58,7 +58,7 @@ public class UrlResolverByIdTest {
|
|||
}
|
||||
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
public void getUrlbyIdNotPaylloadCheck() throws RemoteBackendException {
|
||||
String url=client.getUrl(true).RFile(remotePath);
|
||||
System.out.println("url generated: "+url);
|
||||
|
@ -165,9 +165,9 @@ public class UrlResolverByIdTest {
|
|||
String id=client.remove().RFile(remotePath);
|
||||
List<StorageObject> list=client.showDir().RDir("Uritest/img");
|
||||
assertTrue(list.isEmpty());
|
||||
// String id2=client.remove().RFile(newPath);
|
||||
// List<StorageObject> list2=client.showDir().RDir("Uritest/img5");
|
||||
// assertTrue(list.isEmpty());
|
||||
String id2=client.remove().RFile(newPath);
|
||||
List<StorageObject> list2=client.showDir().RDir("Uritest/img5");
|
||||
assertTrue(list.isEmpty());
|
||||
removeLocalFiles();
|
||||
}
|
||||
|
||||
|
|
|
@ -28,10 +28,12 @@ public class UrlResolverTest {
|
|||
private String remotePath="/test/img4/CostaRicaine.jpg";
|
||||
private String absoluteLocalPath;
|
||||
private String newFilePath="src/test/resources";
|
||||
private String id=null;
|
||||
|
||||
@Before
|
||||
public void init() throws RemoteBackendException{
|
||||
ScopeProvider.instance.set(Costants.DEFAULT_SCOPE_STRING);
|
||||
|
||||
try {
|
||||
client = new StorageClient(serviceClass, serviceName, owner , AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
|
||||
} catch (Exception e) {
|
||||
|
@ -39,7 +41,7 @@ public class UrlResolverTest {
|
|||
e.printStackTrace();
|
||||
}
|
||||
setLocalResources();
|
||||
String id=client.put(true).LFile(absoluteLocalPath).RFile(remotePath);
|
||||
id=client.put(false).LFile(absoluteLocalPath).RFile(remotePath);
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,12 +57,26 @@ public class UrlResolverTest {
|
|||
System.out.println("HttpUrl generated: "+url);
|
||||
}
|
||||
|
||||
// @After
|
||||
// public void removeRemoteFile() throws RemoteBackendException{
|
||||
// String id=client.remove().RFile(remotePath);
|
||||
// List<StorageObject> list=client.showDir().RDir("test/img4");
|
||||
// assertTrue(list.isEmpty());
|
||||
// }
|
||||
|
||||
@Test
|
||||
public void testSerialStorage(){
|
||||
long start=System.currentTimeMillis();
|
||||
int n=100;
|
||||
for(int i = 0; i<n;i++){
|
||||
System.out.println("retrieve "+(i+1)+" url");
|
||||
//get ID
|
||||
System.out.println(client.getHttpsUrl().RFile(id));
|
||||
}
|
||||
long time=System.currentTimeMillis() - start;
|
||||
System.out.println("test serial storage. Total time on "+n+" objects: "+time);
|
||||
}
|
||||
|
||||
@After
|
||||
public void removeRemoteFile() throws RemoteBackendException{
|
||||
String id=client.remove().RFile(remotePath);
|
||||
List<StorageObject> list=client.showDir().RDir("test/img4");
|
||||
assertTrue(list.isEmpty());
|
||||
}
|
||||
|
||||
|
||||
private void setLocalResources() {
|
||||
|
|
Loading…
Reference in New Issue