1 /*
2  * This file was automatically generated by EvoSuite
3  * Fri Jan 12 12:39:39 GMT 2018
4  */
5 
6 package uk.ac.sanger.artemis.components.genebuilder;
7 
8 import org.junit.Test;
9 import static org.junit.Assert.*;
10 import static org.evosuite.runtime.EvoAssertions.*;
11 import java.awt.datatransfer.Clipboard;
12 import java.awt.event.MouseEvent;
13 import java.io.IOException;
14 import java.util.List;
15 import javax.swing.DebugGraphics;
16 import org.apache.batik.dom.GenericDOMImplementation;
17 import org.apache.batik.dom.GenericDocument;
18 import org.apache.batik.dom.GenericDocumentType;
19 import org.apache.batik.svggen.DefaultExtensionHandler;
20 import org.apache.batik.svggen.DefaultImageHandler;
21 import org.apache.batik.svggen.ImageHandlerBase64Encoder;
22 import org.apache.batik.svggen.SVGGeneratorContext;
23 import org.apache.batik.svggen.SVGGraphics2D;
24 import org.biojava.bio.seq.NewSimpleAssembly;
25 import org.evosuite.runtime.EvoRunner;
26 import org.evosuite.runtime.EvoRunnerParameters;
27 import org.junit.runner.RunWith;
28 import org.w3c.dom.DOMImplementation;
29 import uk.ac.sanger.artemis.FeatureVector;
30 import uk.ac.sanger.artemis.Selection;
31 import uk.ac.sanger.artemis.chado.ClusterLazyQualifierValue;
32 import uk.ac.sanger.artemis.components.genebuilder.ProteinMapPanel;
33 import uk.ac.sanger.artemis.io.BlastEntryInformation;
34 import uk.ac.sanger.artemis.io.ChadoCanonicalGene;
35 import uk.ac.sanger.artemis.io.Feature;
36 import uk.ac.sanger.artemis.io.GFFStreamFeature;
37 import uk.ac.sanger.artemis.io.GenbankStreamFeature;
38 import uk.ac.sanger.artemis.io.IndexedGFFDocumentEntry;
39 import uk.ac.sanger.artemis.io.Key;
40 import uk.ac.sanger.artemis.io.Qualifier;
41 import uk.ac.sanger.artemis.io.QualifierLazyLoading;
42 import uk.ac.sanger.artemis.io.QualifierVector;
43 import uk.ac.sanger.artemis.util.Document;
44 import uk.ac.sanger.artemis.util.StringVector;
45 
46 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
47 public class ProteinMapPanel_ESTest extends ProteinMapPanel_ESTest_scaffolding {
48 
49   @Test(timeout = 4000)
test00()50   public void test00()  throws Throwable  {
51       ChadoCanonicalGene chadoCanonicalGene0 = new ChadoCanonicalGene();
52       chadoCanonicalGene0.setSrcfeature_id(0);
53       chadoCanonicalGene0.getTranscriptFeatureFromName("R");
54       Clipboard clipboard0 = new Clipboard("R");
55       Selection selection0 = new Selection(clipboard0);
56       ProteinMapPanel proteinMapPanel0 = new ProteinMapPanel((Feature) null, chadoCanonicalGene0, selection0);
57       // Undeclared exception!
58       try {
59         proteinMapPanel0.getToolTipText((MouseEvent) null);
60         fail("Expecting exception: NullPointerException");
61 
62       } catch(NullPointerException e) {
63          //
64          // no message in exception (getMessage() returned null)
65          //
66          verifyException("uk.ac.sanger.artemis.components.genebuilder.ProteinMapPanel", e);
67       }
68   }
69 
70   @Test(timeout = 4000)
test01()71   public void test01()  throws Throwable  {
72       GenbankStreamFeature genbankStreamFeature0 = new GenbankStreamFeature();
73       ChadoCanonicalGene chadoCanonicalGene0 = new ChadoCanonicalGene();
74       Clipboard clipboard0 = new Clipboard("Filter minimum score must be less than maximum score");
75       Selection selection0 = new Selection(clipboard0);
76       ProteinMapPanel proteinMapPanel0 = new ProteinMapPanel(genbankStreamFeature0, chadoCanonicalGene0, selection0);
77       selection0.getAllSegments();
78       MouseEvent mouseEvent0 = new MouseEvent(proteinMapPanel0, 4, 4, 4, 4, (-678), 4, true);
79       MouseEvent.getMouseModifiersText(58);
80       proteinMapPanel0.getToolTipText(mouseEvent0);
81       GenericDocumentType genericDocumentType0 = new GenericDocumentType(")Q5S0sxmu!^O", "", (String) null);
82       GenericDocument genericDocument0 = new GenericDocument(genericDocumentType0, (DOMImplementation) null);
83       SVGGeneratorContext sVGGeneratorContext0 = SVGGeneratorContext.createDefault(genericDocument0);
84       SVGGraphics2D sVGGraphics2D0 = new SVGGraphics2D(sVGGeneratorContext0, true);
85       SVGGraphics2D sVGGraphics2D1 = new SVGGraphics2D(sVGGraphics2D0);
86       proteinMapPanel0.drawPrediction(genbankStreamFeature0, sVGGraphics2D1, 0, 0, 1406, 1368, (String[]) null);
87       assertFalse(proteinMapPanel0.isFocusCycleRoot());
88   }
89 
90   @Test(timeout = 4000)
test02()91   public void test02()  throws Throwable  {
92       BlastEntryInformation blastEntryInformation0 = new BlastEntryInformation();
93       Key key0 = Key.CDS;
94       blastEntryInformation0.getValidQualifierNames(key0);
95       Qualifier qualifier0 = new Qualifier("61pi", (StringVector) null);
96       ProteinMapPanel.isProteinMapElement(qualifier0);
97       ChadoCanonicalGene chadoCanonicalGene0 = new ChadoCanonicalGene();
98       chadoCanonicalGene0.getTranscriptFeatureFromName("61pi");
99       Clipboard clipboard0 = new Clipboard("61pi");
100       Selection selection0 = new Selection(clipboard0);
101       ProteinMapPanel proteinMapPanel0 = new ProteinMapPanel((Feature) null, chadoCanonicalGene0, selection0);
102       GenericDocumentType genericDocumentType0 = new GenericDocumentType("polypeptide_domain", "polypeptide_domain", "Xw`Mme {~* 3zo;P|74");
103       GenericDOMImplementation genericDOMImplementation0 = new GenericDOMImplementation();
104       GenericDocument genericDocument0 = new GenericDocument(genericDocumentType0, genericDOMImplementation0);
105       SVGGraphics2D sVGGraphics2D0 = new SVGGraphics2D(genericDocument0);
106       QualifierLazyLoading qualifierLazyLoading0 = new QualifierLazyLoading("", (List) null);
107       // Undeclared exception!
108       try {
109         proteinMapPanel0.drawGPIArrow(sVGGraphics2D0, qualifierLazyLoading0, (short)4, (short)8, 1048576, (short)1);
110         fail("Expecting exception: NullPointerException");
111 
112       } catch(NullPointerException e) {
113          //
114          // no message in exception (getMessage() returned null)
115          //
116          verifyException("uk.ac.sanger.artemis.components.genebuilder.ProteinMapPanel", e);
117       }
118   }
119 
120   @Test(timeout = 4000)
test03()121   public void test03()  throws Throwable  {
122       GenbankStreamFeature genbankStreamFeature0 = new GenbankStreamFeature();
123       ChadoCanonicalGene chadoCanonicalGene0 = new ChadoCanonicalGene();
124       Clipboard clipboard0 = new Clipboard("");
125       Selection selection0 = new Selection(clipboard0);
126       ProteinMapPanel proteinMapPanel0 = new ProteinMapPanel(genbankStreamFeature0, chadoCanonicalGene0, selection0);
127       GenericDocumentType genericDocumentType0 = new GenericDocumentType("polypeptide_domain", "", "");
128       GenericDocument genericDocument0 = new GenericDocument(genericDocumentType0, (DOMImplementation) null);
129       SVGGeneratorContext sVGGeneratorContext0 = SVGGeneratorContext.createDefault(genericDocument0);
130       SVGGraphics2D sVGGraphics2D0 = new SVGGraphics2D(sVGGeneratorContext0, true);
131       SVGGraphics2D sVGGraphics2D1 = new SVGGraphics2D(sVGGraphics2D0);
132       String[] stringArray0 = new String[9];
133       stringArray0[0] = "polypeptide_domain";
134       stringArray0[1] = "";
135       stringArray0[2] = "ISO-8859-1";
136       stringArray0[3] = "ISO-8859-1";
137       stringArray0[4] = "ISO-8859-1";
138       stringArray0[5] = "ISO-8859-1";
139       stringArray0[6] = "/~Isj|R'Cxl";
140       stringArray0[7] = "";
141       stringArray0[8] = "ISO-8859-1";
142       proteinMapPanel0.drawPrediction(genbankStreamFeature0, sVGGraphics2D1, (short)4, 3, 3, 583, stringArray0);
143       assertEquals(3, SVGGraphics2D.DEFAULT_MAX_GC_OVERRIDES);
144   }
145 
146   @Test(timeout = 4000)
test04()147   public void test04()  throws Throwable  {
148       ChadoCanonicalGene chadoCanonicalGene0 = new ChadoCanonicalGene();
149       ProteinMapPanel proteinMapPanel0 = new ProteinMapPanel((Feature) null, chadoCanonicalGene0, (Selection) null);
150       GenericDocumentType genericDocumentType0 = new GenericDocumentType("polypeptide_domain", "polypeptide_domain", "polypeptide_domain");
151       GenericDOMImplementation genericDOMImplementation0 = new GenericDOMImplementation();
152       GenericDocument genericDocument0 = new GenericDocument(genericDocumentType0, genericDOMImplementation0);
153       ImageHandlerBase64Encoder imageHandlerBase64Encoder0 = new ImageHandlerBase64Encoder();
154       DefaultExtensionHandler defaultExtensionHandler0 = new DefaultExtensionHandler();
155       SVGGraphics2D sVGGraphics2D0 = new SVGGraphics2D(genericDocument0, imageHandlerBase64Encoder0, defaultExtensionHandler0, false);
156       DebugGraphics debugGraphics0 = new DebugGraphics(sVGGraphics2D0);
157       // Undeclared exception!
158       try {
159         proteinMapPanel0.paintComponent(debugGraphics0);
160         fail("Expecting exception: ClassCastException");
161 
162       } catch(ClassCastException e) {
163          //
164          // javax.swing.DebugGraphics cannot be cast to java.awt.Graphics2D
165          //
166          verifyException("uk.ac.sanger.artemis.components.genebuilder.ProteinMapPanel", e);
167       }
168   }
169 
170   @Test(timeout = 4000)
test05()171   public void test05()  throws Throwable  {
172       Clipboard clipboard0 = new Clipboard("");
173       Selection selection0 = new Selection(clipboard0);
174       ProteinMapPanel proteinMapPanel0 = new ProteinMapPanel((Feature) null, (ChadoCanonicalGene) null, selection0);
175       GenericDocumentType genericDocumentType0 = new GenericDocumentType("polypeptide_domain", "cytoplasm_location", "transmembrane_polypeptide_region");
176       GenericDOMImplementation genericDOMImplementation0 = new GenericDOMImplementation();
177       GenericDocument genericDocument0 = new GenericDocument(genericDocumentType0, genericDOMImplementation0);
178       SVGGraphics2D sVGGraphics2D0 = new SVGGraphics2D(genericDocument0);
179       SVGGraphics2D sVGGraphics2D1 = new SVGGraphics2D(sVGGraphics2D0);
180       String[] stringArray0 = new String[3];
181       stringArray0[0] = "transmembrane_polypeptide_region";
182       stringArray0[1] = "ISO-8859-1";
183       stringArray0[2] = "ISO-8859-1";
184       // Undeclared exception!
185       try {
186         proteinMapPanel0.drawPrediction((Feature) null, sVGGraphics2D1, 0, (short)8, (short)16, (short)1, stringArray0);
187         fail("Expecting exception: NullPointerException");
188 
189       } catch(NullPointerException e) {
190          //
191          // no message in exception (getMessage() returned null)
192          //
193          verifyException("uk.ac.sanger.artemis.components.genebuilder.ProteinMapPanel", e);
194       }
195   }
196 
197   @Test(timeout = 4000)
test06()198   public void test06()  throws Throwable  {
199       ChadoCanonicalGene chadoCanonicalGene0 = new ChadoCanonicalGene();
200       FeatureVector featureVector0 = new FeatureVector();
201       StringVector stringVector0 = uk.ac.sanger.artemis.Feature.getAllQualifierNames(featureVector0);
202       chadoCanonicalGene0.containsTranscript(stringVector0);
203       ProteinMapPanel proteinMapPanel0 = new ProteinMapPanel((Feature) null, chadoCanonicalGene0, (Selection) null);
204       GenericDocumentType genericDocumentType0 = new GenericDocumentType("polypeptide_domain", "polypeptide_domain", "polypeptide_domain");
205       DOMImplementation dOMImplementation0 = GenericDOMImplementation.getDOMImplementation();
206       GenericDocument genericDocument0 = new GenericDocument(genericDocumentType0, dOMImplementation0);
207       DefaultImageHandler defaultImageHandler0 = new DefaultImageHandler();
208       DefaultExtensionHandler defaultExtensionHandler0 = new DefaultExtensionHandler();
209       SVGGraphics2D sVGGraphics2D0 = new SVGGraphics2D(genericDocument0, defaultImageHandler0, defaultExtensionHandler0, true);
210       SVGGraphics2D sVGGraphics2D1 = new SVGGraphics2D(sVGGraphics2D0);
211       // Undeclared exception!
212       try {
213         proteinMapPanel0.drawDomain((Feature) null, sVGGraphics2D1, (short)4, (-2039), (short)1, (short)1);
214         fail("Expecting exception: NullPointerException");
215 
216       } catch(NullPointerException e) {
217          //
218          // no message in exception (getMessage() returned null)
219          //
220          verifyException("uk.ac.sanger.artemis.components.genebuilder.ProteinMapPanel", e);
221       }
222   }
223 
224   @Test(timeout = 4000)
test07()225   public void test07()  throws Throwable  {
226       // Undeclared exception!
227       try {
228         ProteinMapPanel.getProteinMapQualifiers((uk.ac.sanger.artemis.Feature) null);
229         fail("Expecting exception: NullPointerException");
230 
231       } catch(NullPointerException e) {
232          //
233          // no message in exception (getMessage() returned null)
234          //
235          verifyException("uk.ac.sanger.artemis.components.genebuilder.ProteinMapPanel", e);
236       }
237   }
238 
239   @Test(timeout = 4000)
test08()240   public void test08()  throws Throwable  {
241       // Undeclared exception!
242       try {
243         ProteinMapPanel.getProteinsWithProteinMapElement((GFFStreamFeature) null);
244         fail("Expecting exception: NullPointerException");
245 
246       } catch(NullPointerException e) {
247          //
248          // no message in exception (getMessage() returned null)
249          //
250          verifyException("uk.ac.sanger.artemis.components.genebuilder.ProteinMapPanel", e);
251       }
252   }
253 
254   @Test(timeout = 4000)
test09()255   public void test09()  throws Throwable  {
256       ClusterLazyQualifierValue clusterLazyQualifierValue0 = new ClusterLazyQualifierValue(":vcma-^;@5YIzf", ":vcma-^;@5YIzf", (GFFStreamFeature) null);
257       QualifierLazyLoading qualifierLazyLoading0 = new QualifierLazyLoading(":vcma-^;@5YIzf", clusterLazyQualifierValue0);
258       boolean boolean0 = ProteinMapPanel.isProteinMapElement(qualifierLazyLoading0);
259       assertFalse(boolean0);
260   }
261 
262   @Test(timeout = 4000)
test10()263   public void test10()  throws Throwable  {
264       QualifierVector qualifierVector0 = new QualifierVector();
265       qualifierVector0.getQualifierByName("");
266       // Undeclared exception!
267       try {
268         ProteinMapPanel.isProteinMapElement((Qualifier) null);
269         fail("Expecting exception: NullPointerException");
270 
271       } catch(NullPointerException e) {
272          //
273          // no message in exception (getMessage() returned null)
274          //
275          verifyException("uk.ac.sanger.artemis.components.genebuilder.ProteinMapPanel", e);
276       }
277   }
278 
279   @Test(timeout = 4000)
test11()280   public void test11()  throws Throwable  {
281       Key key0 = Key.CDS;
282       NewSimpleAssembly newSimpleAssembly0 = null;
283       try {
284         newSimpleAssembly0 = new NewSimpleAssembly("", "");
285         fail("Expecting exception: NoClassDefFoundError");
286 
287       } catch(NoClassDefFoundError e) {
288          //
289          // Could not initialize class org.biojava.bio.seq.DNATools
290          //
291          verifyException("org.biojava.bio.seq.impl.NewAssembledSymbolList", e);
292       }
293   }
294 
295   @Test(timeout = 4000)
test12()296   public void test12()  throws Throwable  {
297       Document document0 = null;
298       IndexedGFFDocumentEntry indexedGFFDocumentEntry0 = new IndexedGFFDocumentEntry((Document) null);
299   }
300 
301   @Test(timeout = 4000)
test13()302   public void test13()  throws Throwable  {
303       String string0 = "query";
304       GFFStreamFeature gFFStreamFeature0 = null;
305       try {
306         gFFStreamFeature0 = new GFFStreamFeature("query");
307         fail("Expecting exception: IOException");
308 
309       } catch(Throwable e) {
310          //
311          // invalid GFF line: 8 fields needed (got 1 fields) from: query
312          //
313          verifyException("uk.ac.sanger.artemis.io.GFFStreamFeature", e);
314       }
315   }
316 }
317