You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2015/06/07 19:01:25 UTC
[44/44] airavata git commit: Removing test code
Removing test code
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/8bd562af
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/8bd562af
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/8bd562af
Branch: refs/heads/mongo-registry
Commit: 8bd562af4dd0435fb142a1104d660e97293bafbc
Parents: 8217630
Author: Supun Nakandala <sc...@apache.org>
Authored: Sun Jun 7 22:28:43 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Sun Jun 7 22:28:43 2015 +0530
----------------------------------------------------------------------
.../persistance/registry/mongo/Test.java | 79 --------------------
.../registry/mongo/dao/ExperimentDao.java | 10 +--
2 files changed, 5 insertions(+), 84 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/8bd562af/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/Test.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/Test.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/Test.java
deleted file mode 100644
index cb935e1..0000000
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/Test.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.persistance.registry.mongo;
-
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.persistance.registry.mongo.impl.RegistryFactory;
-import org.apache.airavata.persistance.registry.mongo.dao.ExperimentDao;
-import org.apache.airavata.persistance.registry.mongo.utils.MongoUtil;
-import org.apache.airavata.registry.cpi.Registry;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.apache.airavata.registry.cpi.RegistryModelType;
-import org.junit.Assert;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-
-public class Test {
- private final static Logger logger = LoggerFactory.getLogger(Test.class);
-
- public static void main(String[] args) throws RegistryException, IOException {
- Registry registry = RegistryFactory.getDefaultRegistry();
-// String experiemtnId = "SLM-Espresso-Stampede_45667ea8-aae3-4a8e-807d-a16312035c35";
-// long time1 = System.currentTimeMillis();
-// Experiment experiement = (Experiment) registry.getExperiment(RegistryModelType.EXPERIMENT, experiemtnId);
-// long time2 = System.currentTimeMillis();
-// System.out.println(time2-time1);
-//
-// ExperimentDao experimentDao = new ExperimentDao();
-// experimentDao.createExperiment(experiement);
-// time1 = System.currentTimeMillis();
-// Experiment persistedExperiment = experimentDao.getExperiment(experiement.getExperimentId());
-// time2 = System.currentTimeMillis();
-// System.out.println(time2-time1);
-//
-// Assert.assertEquals(experiement, persistedExperiment);
-
- MongoUtil.dropAiravataRegistry();
-
- ExperimentDao experimentDao = new ExperimentDao();
- BufferedReader reader = new BufferedReader(new FileReader("/home/supun/Downloads/EXPERIMENT.csv"));
- String temp = reader.readLine();
- int i = 1;
- while(temp != null && !temp.isEmpty()){
- try{
- Experiment experiement = (Experiment) registry.get(RegistryModelType.EXPERIMENT, temp.trim());
- experimentDao.createExperiment(experiement);
- Experiment persistedExperiment = experimentDao.getExperiment(experiement.getExperimentId());
- Assert.assertEquals(experiement, persistedExperiment);
- System.out.println(i+" :"+experiement.getExperimentId());
- i++;
- }catch (Exception e){
- System.out.println(temp);
- e.printStackTrace();
- }
- temp = reader.readLine();
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/8bd562af/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/dao/ExperimentDao.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/dao/ExperimentDao.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/dao/ExperimentDao.java
index 5e7e43d..bde24d6 100644
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/dao/ExperimentDao.java
+++ b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/mongo/dao/ExperimentDao.java
@@ -75,11 +75,11 @@ public class ExperimentDao{
collection.createIndex(new BasicDBObject(WORKFLOW_NODE_ID, 1));
collection.createIndex(new BasicDBObject(TASK_ID, 1));
-// //Defining a full-text index on experiment name and experiment description
-// BasicDBObject object = new BasicDBObject();
-// object.put(EXPERIMENT_NAME, "text");
-// object.put(EXPERIMENT_DESCRIPTION, "text");
-// collection.createIndex (object);
+ //Defining a full-text index on experiment name and experiment description
+ BasicDBObject object = new BasicDBObject();
+ object.put(EXPERIMENT_NAME, "text");
+ object.put(EXPERIMENT_DESCRIPTION, "text");
+ collection.createIndex (object);
}
public List<Experiment> getAllExperiments() throws RegistryException{