http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/B3PW91/B3PW91GridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/B3PW91/B3PW91GridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/B3PW91/B3PW91GridChemParserTest.java new file mode 100644 index 0000000..28a76aa --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/B3PW91/B3PW91GridChemParserTest.java @@ -0,0 +1,62 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.B3PW91; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.B3PW91.B3PW91Parser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.util.Map; + + +public class B3PW91GridChemParserTest extends AbstractGridChemParserTest { + + private Logger logger = Logger.getLogger(B3PW91GridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testB3PW91Parser() { + boolean exception = false; + try { + B3PW91Parser p = new B3PW91Parser(new FileReader(TEST_OUTPUT)); + p.parse(); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +}
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/CbsQ/CbsQGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/CbsQ/CbsQGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/CbsQ/CbsQGridChemParserTest.java new file mode 100644 index 0000000..c898ad3 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/CbsQ/CbsQGridChemParserTest.java @@ -0,0 +1,59 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.CbsQ; + +import junit.framework.Assert; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.apache.airavata.datacat.parsers.gridchem.cbsQ.CbsQParser; +import org.apache.log4j.Logger; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.util.HashMap; + +public class CbsQGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(CbsQGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testCbsQParser() { + boolean exception = false; + try { + CbsQParser p= new CbsQParser(new FileReader(TEST_OUTPUT)); + HashMap<String,String> map=p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(map.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/G1/G1GridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/G1/G1GridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/G1/G1GridChemParserTest.java new file mode 100644 index 0000000..6b47962 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/G1/G1GridChemParserTest.java @@ -0,0 +1,58 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.G1; + +import junit.framework.Assert; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.apache.airavata.datacat.parsers.gridchem.g1.G1Parser; +import org.apache.log4j.Logger; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class G1GridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(G1GridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testG1Parser() { + boolean exception = false; + try { + G1Parser p = new G1Parser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/GridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/GridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/GridChemParserTest.java new file mode 100644 index 0000000..83bdac4 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/GridChemParserTest.java @@ -0,0 +1,61 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem; + +import junit.framework.Assert; +import org.apache.airavata.datacat.models.OutputMetadataDTO; +import org.apache.airavata.datacat.models.OutputMonitorMessage; +import org.apache.airavata.datacat.models.OutputMonitorMessageType; +import org.apache.airavata.datacat.parsers.gridchem.GridChemParser; +import org.apache.airavata.datacat.parsers.gridchem.util.Constants; +import org.apache.airavata.datacat.parsers.gridchem.util.GridChemProperties; +import org.apache.log4j.Logger; +import org.junit.Before; +import org.junit.Test; + +public class GridChemParserTest { + private Logger log = Logger.getLogger(GridChemParserTest.class); + private String SAMPLE_DATA; + + private OutputMonitorMessage outputMonitorMessage; + private GridChemParser parser; + + @Before + public void setup() { + //configuring the data root + SAMPLE_DATA = GridChemProperties.getInstance().getProperty(Constants.SAMPLE_OUTPUT, ""); + + parser = new GridChemParser(); + outputMonitorMessage = new OutputMonitorMessage(); + + //creating a dummy file monitor message + outputMonitorMessage.setExperimentName("2H2OOHNCmin.com.out"); + outputMonitorMessage.setOutputPath(SAMPLE_DATA); + outputMonitorMessage.setFileMonitorMessageType(OutputMonitorMessageType.FILE_CREATED); + log.info("File Monitor message initialized ..."); + } + + @Test + public void testGCParserSingleOutput() { + OutputMetadataDTO metadataDTO = parser.parse(outputMonitorMessage); + Assert.assertNotNull(metadataDTO); + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5a/MP2to5aGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5a/MP2to5aGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5a/MP2to5aGridChemParserTest.java new file mode 100644 index 0000000..9471235 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5a/MP2to5aGridChemParserTest.java @@ -0,0 +1,60 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.MP2to5a; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.mp2to5a.MP2to5aParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + + +public class MP2to5aGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(MP2to5aGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testMP2to5aParser() { + boolean exception = false; + try { + MP2to5aParser p = new MP2to5aParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5b/MP2to5bGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5b/MP2to5bGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5b/MP2to5bGridChemParserTest.java new file mode 100644 index 0000000..8e7c028 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5b/MP2to5bGridChemParserTest.java @@ -0,0 +1,58 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.MP2to5b; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.mp2to5b.MP2to5bParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class MP2to5bGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(MP2to5bGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testMP2to5bParser() { + boolean exception = false; + try { + MP2to5bParser p = new MP2to5bParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..." + e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } + } http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5c/MP2to5cGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5c/MP2to5cGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5c/MP2to5cGridChemParserTest.java new file mode 100644 index 0000000..297a5e3 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/MP2to5c/MP2to5cGridChemParserTest.java @@ -0,0 +1,58 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.MP2to5c; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.mp2to5c.MP2to5cParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class MP2to5cGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(MP2to5cGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testMP2to5cParser() { + boolean exception = false; + try { + MP2to5cParser p = new MP2to5cParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/ParserParameterizedTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/ParserParameterizedTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/ParserParameterizedTest.java new file mode 100644 index 0000000..352ecc5 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/ParserParameterizedTest.java @@ -0,0 +1,461 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.B3PW91.B3PW91Parser; +import org.apache.airavata.datacat.parsers.gridchem.GridChemQueueParser; +import org.apache.airavata.datacat.parsers.gridchem.cbsQ.CbsQParser; +import org.apache.airavata.datacat.parsers.gridchem.finalcoord.FinalCoordParser; +import org.apache.airavata.datacat.parsers.gridchem.g1.G1Parser; +import org.apache.airavata.datacat.parsers.gridchem.gaussian.GaussianParser; +import org.apache.airavata.datacat.parsers.gridchem.gfinalcoord.GFinalCoordParser; +import org.apache.airavata.datacat.parsers.gridchem.gmcscfa.GmcscfaParser; +import org.apache.airavata.datacat.parsers.gridchem.gnumatom.GNumAtomParser; +import org.apache.airavata.datacat.parsers.gridchem.gopt.GoptParser; +import org.apache.airavata.datacat.parsers.gridchem.gscfa.GscfaParser; +import org.apache.airavata.datacat.parsers.gridchem.gvb.GVBParser; +import org.apache.airavata.datacat.parsers.gridchem.input.InputParser; +import org.apache.airavata.datacat.parsers.gridchem.method.MethodParser; +import org.apache.airavata.datacat.parsers.gridchem.mfinalcoord.MFinalCoordParser; +import org.apache.airavata.datacat.parsers.gridchem.mopta.MOptaParser; +import org.apache.airavata.datacat.parsers.gridchem.mp2to5a.MP2to5aParser; +import org.apache.airavata.datacat.parsers.gridchem.mp2to5b.MP2to5bParser; +import org.apache.airavata.datacat.parsers.gridchem.mp2to5c.MP2to5cParser; +import org.apache.airavata.datacat.parsers.gridchem.mp2to5d.MP2to5dParser; +import org.apache.airavata.datacat.parsers.gridchem.scfa.SCFaParser; +import org.apache.airavata.datacat.parsers.gridchem.scfb.SCFbParser; +import org.apache.airavata.datacat.parsers.gridchem.util.Constants; +import org.apache.airavata.datacat.parsers.gridchem.util.GridChemProperties; +import org.apache.log4j.Logger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; + +@RunWith(Parameterized.class) +public class ParserParameterizedTest { + private Logger log = Logger.getLogger(ParserParameterizedTest.class); + + private String filename; + private boolean expected; + private GridChemQueueParser parser; + private String OUTPUT_FILE_PATH; + + + @Parameters + public static Collection<Object[]> data() { + return Arrays.asList(new Object[][]{ + {"2H2OOHNCmin.com.out", true}, + {"2H2OOHNCtsb.com.out", true}, + {"2H2OOHNCtsc.com.out", true}, + {"2H2OOHNCtsd.com.out", true}, + {"2H2OOHNCtse.com.out", true}, + {"2H2OOHNCtsf.com.out", true}, + {"A1MBBTSNTd.com.out",true}, + {"A1MBBTSNTe.com.out",true}, + {"AcArgTS1.com.out",true}, + {"AcArgTS1a.com.out",true}, + {"AcArgTS1mi.com.out",true}, + {"AcArgTS2.com.out",true}, + {"AcArTS1mia.com.out",true}, + {"acetbvTS1.com.out",true}, + {"acetbvTS1a.com.out",true}, + {"acet_bvTSa.com.out",true}, + {"acetbvTSHM.com.out",true}, + {"acetbvTSHM1.com.out",true}, + {"acetHGS.com.out",true}, + {"acetHTS1.com.out",true}, + {"acetHTS1IR.com.out",true}, + {"acetHTS1IRR.com.out",true}, + {"acetHTS2.com.out",true}, + {"acettetTS.com.out",true}, + {"acettetTSa.com.out",true}, + {"acettetTSM.com.out",true}, + {"acettetTSM1.com.out",true}, + {"acetTS1Ha.com.out",true}, + {"acetTSaIRCF.com.out",true}, + {"AchextetB.com.out",true}, + {"AcOHOHTS.com.out",true}, + {"AcOHOHTS1.com.out",true}, + {"AcPhCHtetB.com.out",true}, + {"ActethexA.com.out",true}, + {"ActetPhA.com.out",true}, + {"BalvTSIRCF.com.out",true}, + {"BalvTSIRCR.com.out",true}, + {"CH3oohGS.com.out",true}, + {"CH3oohtet.com.out",true}, + {"CH3oohTS1.com.out",true}, + {"CH3oohTS1a.com.out",true}, + {"CH4_311.com.out",true}, + {"cycAGS1.com.out",true}, + {"cycATS1.com.out",true}, + {"cycAGS1.com.out",true}, + {"cycBTS1.com.out",true}, + {"FL_acOHts4.com.out",true}, + {"FLarcyctsF.com.out",true}, + {"FLox31_311.com.out",true}, + {"H2O_OHNaCl.com.out",true}, + {"H2OOHNaClts.com.out",true}, + {"H2OOHNCltsa.com.out",true}, + {"H2OOHNCltsb.com.out",true}, + {"H2OOHNCltsc.com.out",true}, + {"H2O_OHrad.com.out",true}, + {"H2O_OHradN.com.out",true}, + {"H2OOHradNts.com.out",true}, + {"H2O_OHradts.com.out",true}, + {"H3O_ONaCl.com.out",true}, + {"IQOOGSMeOH.com.out",true}, + {"IQOOGSMeOHa.com.out",true}, + {"IQOOGSMeOHb.com.out",true}, + {"IQOOH.com.out",true}, + {"IQOOHBcIRCF.com.out",true}, + {"IQOOHBcIRCR.com.out",true}, + {"IQOOHBGIRCF.com.out",true}, + {"IQOOHBGIRCR.com.out",true}, + {"IQOOHimts.com.out",true}, + {"IQOOHimtsa.com.out",true}, + {"IQOOHimtsb.com.out",true}, + {"IQOOHIRCF.com.out",true}, + {"IQOOHIRCF6.com.out",true}, + {"IQOOHIRCFa.com.out",true}, + {"IQOOHIRCFre.com.out",true}, + {"IQOOHIRCR.com.out",true}, + {"IQOOHIRCR6.com.out",true}, + {"IQOOHNHCOOH.com.out",true}, + {"IQOOHNHIRCF.com.out",true}, + {"IQOOHNHIRCR.com.out",true}, + {"IQOOHNmin.com.out",true}, + {"IQOOHNmin90.com.out",true}, + {"IQOOHNminUF.com.out",true}, + {"IQOOHNts.com.out",true} + }); + } + + public ParserParameterizedTest(String filename, boolean expected) { + OUTPUT_FILE_PATH = GridChemProperties.getInstance().getProperty(Constants.SAMPLE_OUTPUT, ""); + this.filename = OUTPUT_FILE_PATH +"/"+ filename+"/"+filename; + this.expected = expected; + + + } + + @Test + public void testGOPTParser() { + try { + parser = new GoptParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + + log.info("Parse successful in GoptParser"+filename); + + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + @Test + public void testB3PW91() { + try { + parser = new B3PW91Parser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in B3PW91"+filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + @Test + public void testCbsqParser() { + try { + parser = new CbsQParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Cbsq "+filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testFinalCoordParser() { + try { + parser = new FinalCoordParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in FinalCoord " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testG1Parser() { + try { + parser = new G1Parser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in G1 " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testGaussianParser() { + try { + parser = new GaussianParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Gaussian " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testGFinalCoord() { + try { + parser = new GFinalCoordParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in GfinalCoord Parser " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testGmcsfaParser() { + try { + parser = new GmcscfaParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Gmcsfa Parser " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testGvbParser() { + try { + parser = new GVBParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Gvb Parser " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testGscfaParser() { + try { + parser = new GscfaParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Gscfa Parser " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testGnumatomParser() { + try { + parser = new GNumAtomParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in GnumAtom Parser " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testInputParser() { + try { + parser = new InputParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Input Parser " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testMethodParser() { + try { + parser = new MethodParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in MethodParser " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void testMFinalCoordParser() { + try { + parser = new MFinalCoordParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in MFinalCoord Parser " + filename); + } catch (FileNotFoundException e) { + // log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + // log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void TestMoptaParser() { + try { + parser = new MOptaParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Mopta Parser " + filename); + } catch (FileNotFoundException e) { + log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void TestMp2to5aParser() { + try { + parser = new MP2to5aParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Mp2to5a Parser " + filename); + } catch (FileNotFoundException e) { + log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + + @Test + public void TestMp2to5bParser() { + try { + parser = new MP2to5bParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Mp2to5b Parser " + filename); + } catch (FileNotFoundException e) { + log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void TestMp2to5cParser() { + try { + parser = new MP2to5cParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Mp2to5c Parser " + filename); + } catch (FileNotFoundException e) { + log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void TestMp2to5dParser() { + try { + parser = new MP2to5dParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Mp2to5d Parser " + filename); + } catch (FileNotFoundException e) { + log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void TestScfaParser() { + try { + parser = new SCFaParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Scfa Parser " + filename); + } catch (FileNotFoundException e) { + log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } + + @Test + public void TestScfbParser() { + try { + parser = new SCFbParser(new FileReader(this.filename)); + HashMap<String, String> parsedData = parser.getParsedData(); + Assert.assertEquals(expected, parsedData != null); + log.info("Parse successful in Scfb Parser " + filename); + } catch (FileNotFoundException e) { + log.error("FileNotFound in ..." + e.getMessage()); + } catch (Exception e) { + log.error("Error occurred in parsing " + filename + " : " + e.getMessage()); + } + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/finalcoord/FinalCoordParserGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/finalcoord/FinalCoordParserGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/finalcoord/FinalCoordParserGridChemParserTest.java new file mode 100644 index 0000000..0903401 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/finalcoord/FinalCoordParserGridChemParserTest.java @@ -0,0 +1,60 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.finalcoord; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.finalcoord.FinalCoordParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class FinalCoordParserGridChemParserTest extends AbstractGridChemParserTest { + + private Logger logger = Logger.getLogger(FinalCoordParserGridChemParserTest.class); + + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testFinalCoordParser() { + boolean exception = false; + try { + FinalCoordParser p = new FinalCoordParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gFinalCoord/GFinalCoordGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gFinalCoord/GFinalCoordGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gFinalCoord/GFinalCoordGridChemParserTest.java new file mode 100644 index 0000000..f85dbaf --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gFinalCoord/GFinalCoordGridChemParserTest.java @@ -0,0 +1,60 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.gFinalCoord; + +import junit.framework.Assert; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.apache.airavata.datacat.parsers.gridchem.gfinalcoord.GFinalCoordParser; +import org.apache.log4j.Logger; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + + +public class GFinalCoordGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(GFinalCoordGridChemParserTest.class); + + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testFinalCoordParser() { + boolean exception = false; + try { + GFinalCoordParser p = new GFinalCoordParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gaussian/GaussianParserGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gaussian/GaussianParserGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gaussian/GaussianParserGridChemParserTest.java new file mode 100644 index 0000000..543e58a --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gaussian/GaussianParserGridChemParserTest.java @@ -0,0 +1,57 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.gaussian; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.gaussian.GaussianParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class GaussianParserGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(GaussianParserGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testGoptParser() { + boolean exception = false; + try { + GaussianParser p = new GaussianParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gmcscfa/GMCSCFaGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gmcscfa/GMCSCFaGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gmcscfa/GMCSCFaGridChemParserTest.java new file mode 100644 index 0000000..06e0314 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gmcscfa/GMCSCFaGridChemParserTest.java @@ -0,0 +1,60 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.gmcscfa; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.gmcscfa.GmcscfaParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + + +public class GMCSCFaGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(GMCSCFaGridChemParserTest.class); + + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testGmcsfaParser() { + boolean exception = false; + try { + GmcscfaParser p = new GmcscfaParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gopt/GoptGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gopt/GoptGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gopt/GoptGridChemParserTest.java new file mode 100644 index 0000000..da2d5e4 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gopt/GoptGridChemParserTest.java @@ -0,0 +1,58 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.gopt; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.gopt.GoptParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class GoptGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(GoptGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testGoptParser() { + boolean exception = false; + try { + GoptParser p = new GoptParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gscfa/GscfaGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gscfa/GscfaGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gscfa/GscfaGridChemParserTest.java new file mode 100644 index 0000000..f5e5cab --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gscfa/GscfaGridChemParserTest.java @@ -0,0 +1,59 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.gscfa; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.gscfa.GscfaParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class GscfaGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(GscfaGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testGVBParser() { + boolean exception = false; + try { + GscfaParser p = new GscfaParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } + } + http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gvb/GVBGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gvb/GVBGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gvb/GVBGridChemParserTest.java new file mode 100644 index 0000000..1a8bac2 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/gvb/GVBGridChemParserTest.java @@ -0,0 +1,59 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.gvb; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.gvb.GVBParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class GVBGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(GVBGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testGVBParser() { + boolean exception = false; + try { + GVBParser p = new GVBParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } + } + http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/inchi/InChIGeneratorGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/inchi/InChIGeneratorGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/inchi/InChIGeneratorGridChemParserTest.java new file mode 100644 index 0000000..cc9fb8a --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/inchi/InChIGeneratorGridChemParserTest.java @@ -0,0 +1,68 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.inchi; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.inchi.InChI; +import org.apache.airavata.datacat.parsers.gridchem.inchi.InChIGenerator; +import org.apache.airavata.datacat.parsers.gridchem.util.Constants; +import org.apache.airavata.datacat.parsers.gridchem.util.GridChemProperties; +import org.apache.commons.io.FileUtils; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.File; +import java.io.IOException; +import java.util.UUID; + +public class InChIGeneratorGridChemParserTest extends AbstractGridChemParserTest { + + private Logger logger = Logger.getLogger(InChIGeneratorGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testGetInChI() throws Exception { + try { + String uniqueID = UUID.randomUUID().toString(); + File source = new File(TEST_OUTPUT); + + File dest = new File(GridChemProperties.getInstance().getProperty( + Constants.TMP_DIR,"") + "/" + uniqueID + ".out"); + FileUtils.copyFile(source, dest); + + InChIGenerator inChIGenerator = new InChIGenerator(uniqueID); + InChI inChI = inChIGenerator.getInChI(); + + logger.info("TEST MESSAGE"); + logger.info(inChI.getInchi() + " inchi key: " + inChI.getInchiKey()); + Assert.assertNotNull(inChI.getInchi()); + Assert.assertNotNull(inChI.getInchiKey()); + } catch (IOException ignore) { + ignore.printStackTrace(); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/input/InputGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/input/InputGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/input/InputGridChemParserTest.java new file mode 100644 index 0000000..dd0c10e --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/input/InputGridChemParserTest.java @@ -0,0 +1,60 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.input; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.input.InputParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class InputGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(InputGridChemParserTest.class); + + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testInputParser() { + boolean exception = false; + try { + InputParser p = new InputParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mfinalcoord/MFinalCoordParserGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mfinalcoord/MFinalCoordParserGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mfinalcoord/MFinalCoordParserGridChemParserTest.java new file mode 100644 index 0000000..f136f1a --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mfinalcoord/MFinalCoordParserGridChemParserTest.java @@ -0,0 +1,60 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.mfinalcoord; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.mfinalcoord.MFinalCoordParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class MFinalCoordParserGridChemParserTest extends AbstractGridChemParserTest { + + private Logger logger = Logger.getLogger(MFinalCoordParserGridChemParserTest.class); + + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testMFinalCoordParser() { + boolean exception = false; + try { + MFinalCoordParser p = new MFinalCoordParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mopta/MOptaGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mopta/MOptaGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mopta/MOptaGridChemParserTest.java new file mode 100644 index 0000000..2063b74 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mopta/MOptaGridChemParserTest.java @@ -0,0 +1,58 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.mopta; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.mopta.MOptaParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class MOptaGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(MOptaGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testMoptaParser() { + boolean exception = false; + try { + MOptaParser p = new MOptaParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..." + e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mp2to5d/Mp2to5dGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mp2to5d/Mp2to5dGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mp2to5d/Mp2to5dGridChemParserTest.java new file mode 100644 index 0000000..d1bbf0d --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/mp2to5d/Mp2to5dGridChemParserTest.java @@ -0,0 +1,60 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.mp2to5d; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.mp2to5d.MP2to5dParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + + +public class Mp2to5dGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(Mp2to5dGridChemParserTest.class); + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testMP2to5dParser() { + boolean exception = false; + try { + MP2to5dParser p = new MP2to5dParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + Assert.assertNotNull(results); + logger.info("======= Printing the results=================="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/scfa/SCFaGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/scfa/SCFaGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/scfa/SCFaGridChemParserTest.java new file mode 100644 index 0000000..0182e19 --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/scfa/SCFaGridChemParserTest.java @@ -0,0 +1,60 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.scfa; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.scfa.SCFaParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + +public class SCFaGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(SCFaGridChemParserTest.class); + + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testScfaParser() { + boolean exception = false; + try { + SCFaParser p = new SCFaParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/scfb/SCFbGridChemParserTest.java ---------------------------------------------------------------------- diff --git a/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/scfb/SCFbGridChemParserTest.java b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/scfb/SCFbGridChemParserTest.java new file mode 100644 index 0000000..13bab6b --- /dev/null +++ b/datacat/parsers/src/test/java/org/apche/airavata/datacat/parsers/gridchem/scfb/SCFbGridChemParserTest.java @@ -0,0 +1,60 @@ +/* +* +* 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.apche.airavata.datacat.parsers.gridchem.scfb; + +import junit.framework.Assert; +import org.apache.airavata.datacat.parsers.gridchem.scfb.SCFbParser; +import org.apache.log4j.Logger; +import org.apche.airavata.datacat.parsers.gridchem.AbstractGridChemParserTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.util.Map; + + +public class SCFbGridChemParserTest extends AbstractGridChemParserTest { + private Logger logger = Logger.getLogger(SCFbGridChemParserTest.class); + + + @Before + public void setUp() { + super.setUp(); + } + + @Test + public void testScfbParser() { + boolean exception = false; + try { + SCFbParser p = new SCFbParser(new java.io.FileReader(TEST_OUTPUT)); + Map<String, String> results = p.getParsedData(); + logger.info("======= Printing the results =========="); + logger.info(results.toString()); + } catch (FileNotFoundException e) { + logger.error("File Not Found Exception ..."+e.getMessage()); + exception = true; + } catch (Exception e) { + logger.error("Parse Exception ..." + e.getMessage()); + exception = true; + } + Assert.assertFalse(exception); + } +} http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/pom.xml ---------------------------------------------------------------------- diff --git a/datacat/pom.xml b/datacat/pom.xml new file mode 100644 index 0000000..e3ab6ae --- /dev/null +++ b/datacat/pom.xml @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.airavata.datacat</groupId> + <artifactId>datacat</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + + + <modules> + <module>agent</module> + <module>server</module> + <module>models</module> + <module>regexParser</module> + <module>integration-tests</module> + <module>parsers</module> + </modules> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.2</version> + <configuration> + <source>1.7</source> + <target>1.7</target> + <optimize>true</optimize> + <encoding>UTF-8</encoding> + </configuration> + </plugin> + </plugins> + </build> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>${log4j.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>${sl4j.version}</version> + </dependency> + <dependency> + <groupId>org.codehaus.jackson</groupId> + <artifactId>jackson-mapper-asl</artifactId> + <version>${jackson.version}</version> + </dependency> + </dependencies> + </dependencyManagement> + + <repositories> + <repository> + <id>codehaus</id> + <url>http://repository.codehaus.org/org/codehaus</url> + </repository> + <repository> + <id>wso2-nexus</id> + <name>WSO2 internal Repository</name> + <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url> + <releases> + <enabled>true</enabled> + <updatePolicy>daily</updatePolicy> + <checksumPolicy>ignore</checksumPolicy> + </releases> + </repository> + </repositories> + + <properties> + <jdk.version>1.7</jdk.version> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <junit.version>4.10</junit.version> + <java.version>1.7</java.version> + <sl4j.version>1.6.1</sl4j.version> + <log4j.version>1.2.16</log4j.version> + <guava.version>17.0</guava.version> + <dropwizard.version>0.7.1</dropwizard.version> + <java-cup.version>10k</java-cup.version> + <solrj.version>4.9.0</solrj.version> + <apache-commons.version>1.3.2</apache-commons.version> + <maven-compiler-plugin.version>2.3.2</maven-compiler-plugin.version> + <springframework.version>4.0.0.RELEASE</springframework.version> + <skipTests>false</skipTests> + <jackson.version>1.8.5</jackson.version> + <carbon.version>4.0.0</carbon.version> + <axis2.version>1.6.1.wso2v10</axis2.version> + <thrift.version>0.9.1</thrift.version> + <rabbitmq.version>3.4.1</rabbitmq.version> + <curator.version>2.7.0</curator.version> + <httpclient.version>4.3.1</httpclient.version> + <httpcore.version>4.3</httpcore.version> + <gson.version>2.3</gson.version> + </properties> +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/query.json ---------------------------------------------------------------------- diff --git a/datacat/query.json b/datacat/query.json new file mode 100644 index 0000000..d594428 --- /dev/null +++ b/datacat/query.json @@ -0,0 +1,40 @@ +{ + "username": "sudhakar", + + "userGroups": ["sudhakar"], + + "queryStringSet": false, + + /*A Solr query*/ + "queryString": "*:*", + + "startRow": 0, + + "numberOfRows": 25, + + "primaryQueryParameterList": [ + { + "primaryQueryType": "EQUALS", + "firstParameter": "InChI=1S/C5H9O4.C2H8N3/c1-4(6)8-9-5(2,3)7;1-5-2(3)4/h1-3H3;5H,3-4H2,1H3", + "secondParameter": null, + "field": "InChi_s" + }, + { + "primaryQueryType": "SUBSTRING", + "firstParameter": "C5H9O4", + "secondParameter": null, + "field": "InChi_s" + }, + { + "primaryQueryType": "RANGE", + "firstParameter": "*", + "secondParameter": "2015-09-08T00:43:54Z", + "field": "createdDate" + }, + { + "primaryQueryType": "PHRASE", + "firstParameter": "InChI=1S/C5H9O4.C2H8N3/c1-4(6)8-9-5(2,3)7;1-5-2(3)4/h1-3H3;5H,3-4H2,1H3", + "secondParameter": null, + "field": "InChi_s" + } + ]} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/4231ac35/datacat/regexParser/pom.xml ---------------------------------------------------------------------- diff --git a/datacat/regexParser/pom.xml b/datacat/regexParser/pom.xml new file mode 100644 index 0000000..a0a145f --- /dev/null +++ b/datacat/regexParser/pom.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>datacat</artifactId> + <groupId>org.apache.airavata.datacat</groupId> + <version>1.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>RegexParser</artifactId> +<build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.2</version> + <configuration> + <source>${jdk.version}</source> + <target>${jdk.version}</target> + <compilerArgument>-Xlint:unchecked</compilerArgument> + <optimize>true</optimize> + <encoding>UTF-8</encoding> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.3.2</version> + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> +</build> + + <dependencies> + <dependency> + <groupId>org.apache.airavata.datacat</groupId> + <artifactId>parsers</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.airavata.datacat</groupId> + <artifactId>models</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + +</project> \ No newline at end of file
