|
| 1 | +/* |
| 2 | + * BioJava development code |
| 3 | + * |
| 4 | + * This code may be freely distributed and modified under the |
| 5 | + * terms of the GNU Lesser General Public Licence. This should |
| 6 | + * be distributed with the code. If you do not have a copy, |
| 7 | + * see: |
| 8 | + * |
| 9 | + * http://www.gnu.org/copyleft/lesser.html |
| 10 | + * |
| 11 | + * Copyright for this code is held jointly by the individual |
| 12 | + * authors. These should be listed in @author doc comments. |
| 13 | + * |
| 14 | + * For more information on the BioJava project and its aims, |
| 15 | + * or to join the biojava-l mailing list, visit the home page |
| 16 | + * at: |
| 17 | + * |
| 18 | + * http://www.biojava.org/ |
| 19 | + * |
| 20 | + * Created on Jul 7, 2016 |
| 21 | + * Author: blivens |
| 22 | + * |
| 23 | + */ |
| 24 | + |
| 25 | +package org.biojava.http.routes; |
| 26 | + |
| 27 | +import static org.junit.Assert.*; |
| 28 | + |
| 29 | +import java.io.IOException; |
| 30 | + |
| 31 | +import org.biojava.nbio.structure.Atom; |
| 32 | +import org.biojava.nbio.structure.Structure; |
| 33 | +import org.biojava.nbio.structure.StructureException; |
| 34 | +import org.biojava.nbio.structure.StructureIO; |
| 35 | +import org.biojava.nbio.structure.StructureTools; |
| 36 | +import org.biojava.nbio.structure.symmetry.internal.CESymmParameters; |
| 37 | +import org.biojava.nbio.structure.symmetry.internal.CeSymm; |
| 38 | +import org.biojava.nbio.structure.symmetry.internal.CeSymmResult; |
| 39 | +import org.junit.Test; |
| 40 | + |
| 41 | +import com.google.gson.Gson; |
| 42 | + |
| 43 | +public class TestJsonTransformer { |
| 44 | + |
| 45 | + @Test |
| 46 | + public void testCeSymmResult() throws IOException, StructureException { |
| 47 | + Structure s = StructureIO.getStructure("1HIV.A"); |
| 48 | + Atom[] ca = StructureTools.getRepresentativeAtomArray(s); |
| 49 | + CESymmParameters params = new CESymmParameters(); |
| 50 | + params.setSymmLevels(1); |
| 51 | + params.setOptimization(false); |
| 52 | + CeSymmResult result = CeSymm.analyze(ca); |
| 53 | + JsonTransformer trans = new JsonTransformer(); |
| 54 | + String json = trans.render(result); |
| 55 | + |
| 56 | + assertNotNull(json); |
| 57 | + System.out.println(json); |
| 58 | + } |
| 59 | + |
| 60 | +} |
0 commit comments