airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject [1/2] git commit: updated the test to use admin user until we have api function to create users
Date Thu, 24 Apr 2014 20:02:25 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 8c6a9a5a2 -> 053ce56cf


updated the test to use admin user until we have api function to create users


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/55ff3aec
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/55ff3aec
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/55ff3aec

Branch: refs/heads/master
Commit: 55ff3aec6279341dd74915b0048b45ab2704cb0e
Parents: 740bf8c
Author: Saminda Wijeratne <samindaw@gmail.com>
Authored: Thu Apr 24 13:01:15 2014 -0700
Committer: Saminda Wijeratne <samindaw@gmail.com>
Committed: Thu Apr 24 13:01:15 2014 -0700

----------------------------------------------------------------------
 modules/integration-tests/pom.xml                 |  2 +-
 .../airavata/integration/DataRetrievalIT.java     | 18 ++++++++++++------
 2 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/55ff3aec/modules/integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index 85a5134..5e5c95f 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -138,7 +138,7 @@
                     <includes>
                         <!--include>**/*IT.java</include -->
                         <include>**/SimpleEchoIT.java</include>
-                        <!--include>**/DataRetrievalIT.java</include-->
+                        <include>**/DataRetrievalIT.java</include>
                     </includes>
                 </configuration>
                 <executions>

http://git-wip-us.apache.org/repos/asf/airavata/blob/55ff3aec/modules/integration-tests/src/test/java/org/apache/airavata/integration/DataRetrievalIT.java
----------------------------------------------------------------------
diff --git a/modules/integration-tests/src/test/java/org/apache/airavata/integration/DataRetrievalIT.java
b/modules/integration-tests/src/test/java/org/apache/airavata/integration/DataRetrievalIT.java
index 46ab7e9..954dbb8 100644
--- a/modules/integration-tests/src/test/java/org/apache/airavata/integration/DataRetrievalIT.java
+++ b/modules/integration-tests/src/test/java/org/apache/airavata/integration/DataRetrievalIT.java
@@ -58,7 +58,7 @@ public class DataRetrievalIT extends AbstractIntegrationTest {
     //this will keep a list of experiment that was executed. each element will contain {experiemntId,
user, project}
     private List<String[]> experimentDataList;
     
-    private String[] users={"user1","user2","user3","user4"};
+    private String[] users={"admin"};
     private String[] projects={"project1","project2","project3"};
     
     private static final int NUM_OF_EXPERIMENTS=10;
@@ -75,7 +75,7 @@ public class DataRetrievalIT extends AbstractIntegrationTest {
 		log.info("=================");
 		for(int i=1; i<=NUM_OF_EXPERIMENTS;i++){
 			//we are using the last user or project to test data empty scenarios 
-			String user=users[(new Random()).nextInt(users.length-1)];
+			String user=users[(new Random()).nextInt(users.length)];
 			String project=projects[(new Random()).nextInt(projects.length-1)];
 			String experimentId = runExperiment(user, project);
 			experimentDataList.add(new String[]{experimentId,user,project});
@@ -87,7 +87,9 @@ public class DataRetrievalIT extends AbstractIntegrationTest {
     	List<String> results=new ArrayList<String>();
     	for (String[] record : experimentDataList) {
 			if (record[searchIndex].equals(searchString)){
-				results.add(record[returnIndexData]);
+				if (!results.contains(record[returnIndexData])) {
+					results.add(record[returnIndexData]);
+				}
 			}
 		}
     	return results;
@@ -95,7 +97,8 @@ public class DataRetrievalIT extends AbstractIntegrationTest {
 
 	@Test
     public void listingExperimentsByUser() throws Exception {
-		log.info("Testing user experiments...");
+		log.info("Testing user experiments");
+		log.info("========================");
         for (String user : users) {
 			List<Experiment> listUserExperiments = listUserExperiments(user);
 			List<String> data = getData(1, user, 0);
@@ -109,7 +112,8 @@ public class DataRetrievalIT extends AbstractIntegrationTest {
     
 	@Test
     public void listingExperimentsByProject() throws Exception {
-		log.info("Testing project experiments...");
+		log.info("Testing project experiments");
+		log.info("===========================");
         for (String project : projects) {
 			List<Experiment> listProjectExperiments = listProjectExperiments(project);
 			List<String> data = getData(2, project, 0);
@@ -123,10 +127,12 @@ public class DataRetrievalIT extends AbstractIntegrationTest {
 	
 	@Test
     public void listingUserProjects() throws Exception {
-		log.info("Testing user projects...");
+		log.info("Testing user projects");
+		log.info("=====================");
         for (String user : users) {
 			List<Project> listUserProjects = listUserProjects(user);
 			List<String> data = getData(1, user, 2);
+			data.add("default");
         	log.info("\t"+user+" : "+data.size()+" projects");
 			Assert.assertEquals(listUserProjects.size(), data.size());
 			for (Project project : listUserProjects) {


Mime
View raw message