Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Header and modifications to MMFF94BasedParameterSetReaderTest.java

  • Loading branch information...
commit e39a6477370ef3281e2f736a83db56fc121bc51d 1 parent 3a33765
authored April 30, 2012 egonw committed July 29, 2012
133  src/test/org/openscience/cdk/modeling/builder3d/MMFF94BasedParameterSetReaderTest.java
... ...
@@ -1,12 +1,29 @@
  1
+/* Copyright (C) 2000-2007  Christoph Steinbeck 
  2
+ *               2001-2007,2009  Egon Willighagen 
  3
+ *
  4
+ * Contact: cdk-devel@lists.sourceforge.net
  5
+ *
  6
+ * This program is free software; you can redistribute it and/or
  7
+ * modify it under the terms of the GNU Lesser General Public License
  8
+ * as published by the Free Software Foundation; either version 2.1
  9
+ * of the License, or (at your option) any later version.
  10
+ * All we ask is that proper credit is given for our work, which includes
  11
+ * - but is not limited to - adding the above copyright notice to the beginning
  12
+ * of your source code files, and to any copyright notice that you may distribute
  13
+ * with programs based on this work.
  14
+ *
  15
+ * This program is distributed in the hope that it will be useful,
  16
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18
+ * GNU Lesser General Public License for more details.
  19
+ *
  20
+ * You should have received a copy of the GNU Lesser General Public License
  21
+ * along with this program; if not, write to the Free Software
  22
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  23
+ */
1 24
 package org.openscience.cdk.modeling.builder3d;
2 25
 
3  
-
4 26
 import static org.junit.Assert.*;
5  
-
6  
-import java.io.BufferedReader;
7  
-import java.io.IOException;
8  
-import java.io.InputStream;
9  
-import java.io.InputStreamReader;
10 27
 import java.util.ArrayList;
11 28
 import java.util.Map;
12 29
 import java.util.Hashtable;
@@ -16,99 +33,19 @@
16 33
 import org.junit.Test;
17 34
 import org.openscience.cdk.interfaces.IAtomType;
18 35
 
19  
-
20  
-
21  
-
22 36
 /**
23 37
  * This class is for testing the MMFF94 based parameter
24 38
  * reading in CDK.
25 39
  * 
26 40
  * @author danielszisz
27  
- * @see org.openscience.cdk.modeling.builder3d.MMFF94BasedParameterSetReader
  41
+ * @version 04/16/2012
  42
+ * @cdk.module test-builder3d
28 43
  */
29 44
 public class MMFF94BasedParameterSetReaderTest {
30 45
 	
31  
-	private String line, atomline, bondline, angleline, strbndline, torsionline,
32  
-	               opbendline, dataline;
33  
-	private boolean firstatomline = true;
34  
-	private boolean firstbondline = true;
35  
-	private boolean firstangleline = true;
36  
-	private boolean firststrbndline = true;
37  
-	private boolean firsttorsionline = true;
38  
-	private boolean firstopbendline = true;
39  
-	private boolean firstdataline = true;
40  
-	
41  
-	@Deprecated
42  
-	public void initializeMMFF94ParameterFileLines() {
43  
-		String fname = "org/openscience/cdk/modeling/forcefield/data/mmff94.prm";
44  
-		ClassLoader loader = MMFF94BasedParameterSetReader.class.getClassLoader();
45  
-		InputStream inps = loader.getResourceAsStream(fname);
46  
-		BufferedReader r = new BufferedReader(new InputStreamReader(inps), 1024);
47  
-		try {
48  
-			while(true) {
49  
-		line = r.readLine();
50  
-		if(line == null) {
51  
-			break;
52  
-		}
53  
-		else if(line.startsWith("atom")) {
54  
-			if(firstatomline) { 
55  
-				atomline = line;
56  
-				firstatomline = false;
57  
-			}
58  
-			else continue;
59  
-		}
60  
-		else if(line.startsWith("bond")) {
61  
-			if(firstbondline) {
62  
-			bondline = line;
63  
-			firstbondline = false;
64  
-	   	}
65  
-			else continue;
66  
-		}
67  
-		else if(line.startsWith("angle")) {
68  
-			if(firstangleline) {
69  
-				angleline = line;
70  
-				firstangleline = false;
71  
-			}
72  
-			else continue;
73  
-		}
74  
-		else if(line.startsWith("strbnd")) { 
75  
-			if(firststrbndline) {
76  
-				strbndline = line;
77  
-				firststrbndline = false;
78  
-			}
79  
-		}
80  
-		else if(line.startsWith("torsion")) { 
81  
-			if(firsttorsionline) {
82  
-				torsionline = line; 
83  
-				firsttorsionline = false;
84  
-			}
85  
-		}
86  
-		else if(line.startsWith("opbend")) { 
87  
-			if(firstopbendline) {
88  
-				opbendline = line;
89  
-				firstopbendline = false;
90  
-			}
91  
-		}
92  
-		else if(line.startsWith("data")) { 
93  
-			if(firstdataline) {
94  
-				dataline = line;
95  
-				firstdataline = false;
96  
-			}
97  
-		}
98  
-	}
99  
-} catch (IOException ioe) {
100  
-			ioe.printStackTrace();
101  
-		}
102  
-	}
103  
-	
104  
-	@Test
105  
-	public void testreadParameterSets() {
106  
-		MMFF94BasedParameterSetReader mmff94bpsr = new MMFF94BasedParameterSetReader();
107  
-		try { 
108  
-			mmff94bpsr.readParameterSets();
109  
-		} catch(Exception e) {
110  
-			e.printStackTrace();
111  
-		}
  46
+	@Test public void testreadParameterSets() throws Exception {
  47
+		MMFF94BasedParameterSetReader mmff94bpsr = new MMFF94BasedParameterSetReader(); 
  48
+		mmff94bpsr.readParameterSets();
112 49
 		Map<String, Object> parameterSet = new Hashtable<String, Object>();
113 50
 		parameterSet = mmff94bpsr.getParamterSet();
114 51
 		
@@ -126,8 +63,7 @@ public void testreadParameterSets() {
126 63
 
127 64
 		//atom
128 65
 		//TODO testing 
129  
-		
130  
-		
  66
+			
131 67
 		//bond
132 68
 //		String scode = "0";
133 69
 		String sid1 = "C";
@@ -211,15 +147,6 @@ public void testreadParameterSets() {
211 147
 			else if(e.getKey().equals(anglekey)) assertEquals(angledata, e.getValue());
212 148
 			else if(e.getKey().equals(torsionkey)) assertEquals(torsiondata, e.getValue());
213 149
 			else if(e.getKey().equals(opbendkey)) assertEquals(opbenddata, e.getValue());
214  
-		}
215  
-		
216  
-		
217  
-		
218  
-		
219  
-		
  150
+		}		
220 151
 	}
221  
-	
222  
-	
223  
-	
224  
-
225 152
 }

0 notes on commit e39a647

Please sign in to comment.
Something went wrong with that request. Please try again.