Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6A87111C23 for ; Thu, 24 Apr 2014 20:02:29 +0000 (UTC) Received: (qmail 87425 invoked by uid 500); 24 Apr 2014 20:02:26 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 87381 invoked by uid 500); 24 Apr 2014 20:02:26 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 87353 invoked by uid 99); 24 Apr 2014 20:02:26 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Apr 2014 20:02:26 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C614C991BE5; Thu, 24 Apr 2014 20:02:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: samindaw@apache.org To: commits@airavata.apache.org Date: Thu, 24 Apr 2014 20:02:25 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: updated the test to use admin user until we have api function to create users 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 Authored: Thu Apr 24 13:01:15 2014 -0700 Committer: Saminda Wijeratne 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 @@ **/SimpleEchoIT.java - + **/DataRetrievalIT.java 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 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 results=new ArrayList(); 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 listUserExperiments = listUserExperiments(user); List 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 listProjectExperiments = listProjectExperiments(project); List 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 listUserProjects = listUserProjects(user); List 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) {