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 {
|
public void getUrlbyIdNotPaylloadCheck() throws RemoteBackendException {
|
||||||
String url=client.getUrl(true).RFile(remotePath);
|
String url=client.getUrl(true).RFile(remotePath);
|
||||||
System.out.println("url generated: "+url);
|
System.out.println("url generated: "+url);
|
||||||
|
@ -165,9 +165,9 @@ public class UrlResolverByIdTest {
|
||||||
String id=client.remove().RFile(remotePath);
|
String id=client.remove().RFile(remotePath);
|
||||||
List<StorageObject> list=client.showDir().RDir("Uritest/img");
|
List<StorageObject> list=client.showDir().RDir("Uritest/img");
|
||||||
assertTrue(list.isEmpty());
|
assertTrue(list.isEmpty());
|
||||||
// String id2=client.remove().RFile(newPath);
|
String id2=client.remove().RFile(newPath);
|
||||||
// List<StorageObject> list2=client.showDir().RDir("Uritest/img5");
|
List<StorageObject> list2=client.showDir().RDir("Uritest/img5");
|
||||||
// assertTrue(list.isEmpty());
|
assertTrue(list.isEmpty());
|
||||||
removeLocalFiles();
|
removeLocalFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,12 @@ public class UrlResolverTest {
|
||||||
private String remotePath="/test/img4/CostaRicaine.jpg";
|
private String remotePath="/test/img4/CostaRicaine.jpg";
|
||||||
private String absoluteLocalPath;
|
private String absoluteLocalPath;
|
||||||
private String newFilePath="src/test/resources";
|
private String newFilePath="src/test/resources";
|
||||||
|
private String id=null;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void init() throws RemoteBackendException{
|
public void init() throws RemoteBackendException{
|
||||||
ScopeProvider.instance.set(Costants.DEFAULT_SCOPE_STRING);
|
ScopeProvider.instance.set(Costants.DEFAULT_SCOPE_STRING);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
client = new StorageClient(serviceClass, serviceName, owner , AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
|
client = new StorageClient(serviceClass, serviceName, owner , AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -39,7 +41,7 @@ public class UrlResolverTest {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
setLocalResources();
|
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);
|
System.out.println("HttpUrl generated: "+url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @After
|
|
||||||
// public void removeRemoteFile() throws RemoteBackendException{
|
@Test
|
||||||
// String id=client.remove().RFile(remotePath);
|
public void testSerialStorage(){
|
||||||
// List<StorageObject> list=client.showDir().RDir("test/img4");
|
long start=System.currentTimeMillis();
|
||||||
// assertTrue(list.isEmpty());
|
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() {
|
private void setLocalResources() {
|
||||||
|
|
Loading…
Reference in New Issue