1 /*
2  * This file was automatically generated by EvoSuite
3  * Fri Jan 12 16:28:43 GMT 2018
4  */
5 
6 package uk.ac.sanger.artemis.sequence;
7 
8 import org.junit.Test;
9 import static org.junit.Assert.*;
10 import static org.evosuite.runtime.EvoAssertions.*;
11 import org.evosuite.runtime.EvoRunner;
12 import org.evosuite.runtime.EvoRunnerParameters;
13 import org.junit.runner.RunWith;
14 import uk.ac.sanger.artemis.io.FastaStreamSequence;
15 import uk.ac.sanger.artemis.sequence.BasePattern;
16 import uk.ac.sanger.artemis.sequence.Bases;
17 import uk.ac.sanger.artemis.sequence.Marker;
18 import uk.ac.sanger.artemis.sequence.MarkerRange;
19 import uk.ac.sanger.artemis.sequence.MarkerRangeVector;
20 import uk.ac.sanger.artemis.sequence.Strand;
21 
22 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
23 public class BasePattern_ESTest extends BasePattern_ESTest_scaffolding {
24 
25   @Test(timeout = 4000)
test00()26   public void test00()  throws Throwable  {
27       BasePattern basePattern0 = new BasePattern("K");
28       boolean boolean0 = basePattern0.matches("K");
29       assertFalse(boolean0);
30   }
31 
32   @Test(timeout = 4000)
test01()33   public void test01()  throws Throwable  {
34       BasePattern basePattern0 = new BasePattern("r");
35       FastaStreamSequence fastaStreamSequence0 = new FastaStreamSequence("&");
36       Bases bases0 = new Bases(fastaStreamSequence0);
37       MarkerRange markerRange0 = basePattern0.findMatch(bases0, (Marker) null, 862, true, true, false);
38       assertNull(markerRange0);
39   }
40 
41   @Test(timeout = 4000)
test02()42   public void test02()  throws Throwable  {
43       BasePattern basePattern0 = new BasePattern("hr");
44       boolean boolean0 = basePattern0.matches("&");
45       assertFalse(boolean0);
46   }
47 
48   @Test(timeout = 4000)
test03()49   public void test03()  throws Throwable  {
50       BasePattern basePattern0 = new BasePattern("r");
51       FastaStreamSequence fastaStreamSequence0 = new FastaStreamSequence("G~8c[YFB6lQ)E");
52       Bases bases0 = new Bases(fastaStreamSequence0);
53       Strand strand0 = bases0.getReverseStrand();
54       Marker marker0 = strand0.makeMarker(7);
55       MarkerRangeVector markerRangeVector0 = basePattern0.findMatches(bases0, marker0, 1);
56       assertEquals(0, markerRangeVector0.size());
57   }
58 
59   @Test(timeout = 4000)
test04()60   public void test04()  throws Throwable  {
61       // Undeclared exception!
62       try {
63         BasePattern.patternType((String) null);
64         fail("Expecting exception: NullPointerException");
65 
66       } catch(NullPointerException e) {
67          //
68          // no message in exception (getMessage() returned null)
69          //
70          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
71       }
72   }
73 
74   @Test(timeout = 4000)
test05()75   public void test05()  throws Throwable  {
76       BasePattern basePattern0 = new BasePattern("R");
77       // Undeclared exception!
78       try {
79         basePattern0.findMatches((Bases) null, (Marker) null, 3203);
80         fail("Expecting exception: NullPointerException");
81 
82       } catch(NullPointerException e) {
83          //
84          // no message in exception (getMessage() returned null)
85          //
86          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
87       }
88   }
89 
90   @Test(timeout = 4000)
test06()91   public void test06()  throws Throwable  {
92       BasePattern basePattern0 = new BasePattern("g");
93       // Undeclared exception!
94       try {
95         basePattern0.findMatch((Bases) null, (Marker) null, 1063, false, false, false);
96         fail("Expecting exception: NullPointerException");
97 
98       } catch(NullPointerException e) {
99          //
100          // no message in exception (getMessage() returned null)
101          //
102          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
103       }
104   }
105 
106   @Test(timeout = 4000)
test07()107   public void test07()  throws Throwable  {
108       BasePattern basePattern0 = null;
109       try {
110         basePattern0 = new BasePattern((String) null);
111         fail("Expecting exception: NullPointerException");
112 
113       } catch(NullPointerException e) {
114          //
115          // no message in exception (getMessage() returned null)
116          //
117          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
118       }
119   }
120 
121   @Test(timeout = 4000)
test08()122   public void test08()  throws Throwable  {
123       int int0 = BasePattern.patternType("k5Km%#+;#fc%zx@#");
124       assertEquals((-1), int0);
125   }
126 
127   @Test(timeout = 4000)
test09()128   public void test09()  throws Throwable  {
129       int int0 = BasePattern.patternType("mG6h~");
130       assertEquals((-1), int0);
131   }
132 
133   @Test(timeout = 4000)
test10()134   public void test10()  throws Throwable  {
135       int int0 = BasePattern.patternType("f*lS\"T>bE(UnMlK");
136       assertEquals((-1), int0);
137   }
138 
139   @Test(timeout = 4000)
test11()140   public void test11()  throws Throwable  {
141       int int0 = BasePattern.patternType("q/GC[E.[{h~bFb,%56");
142       assertEquals((-1), int0);
143   }
144 
145   @Test(timeout = 4000)
test12()146   public void test12()  throws Throwable  {
147       int int0 = BasePattern.patternType("s1?");
148       assertEquals((-1), int0);
149   }
150 
151   @Test(timeout = 4000)
test13()152   public void test13()  throws Throwable  {
153       int int0 = BasePattern.patternType("o0_LP,fLk4oO7");
154       assertEquals((-1), int0);
155   }
156 
157   @Test(timeout = 4000)
test14()158   public void test14()  throws Throwable  {
159       int int0 = BasePattern.patternType("uk.ac.sanger.artemis.sequence.BasePattern");
160       assertEquals((-1), int0);
161   }
162 
163   @Test(timeout = 4000)
test15()164   public void test15()  throws Throwable  {
165       int int0 = BasePattern.patternType("rna");
166       assertEquals(1, int0);
167   }
168 
169   @Test(timeout = 4000)
test16()170   public void test16()  throws Throwable  {
171       int int0 = BasePattern.patternType("pattern too short");
172       assertEquals((-1), int0);
173   }
174 
175   @Test(timeout = 4000)
test17()176   public void test17()  throws Throwable  {
177       int int0 = BasePattern.patternType("ixj2UGlP8G0d=Z`8");
178       assertEquals((-1), int0);
179   }
180 
181   @Test(timeout = 4000)
test18()182   public void test18()  throws Throwable  {
183       int int0 = BasePattern.patternType("hr");
184       assertEquals(1, int0);
185   }
186 
187   @Test(timeout = 4000)
test19()188   public void test19()  throws Throwable  {
189       int int0 = BasePattern.patternType("g");
190       assertEquals(0, int0);
191   }
192 
193   @Test(timeout = 4000)
test20()194   public void test20()  throws Throwable  {
195       BasePattern basePattern0 = new BasePattern("r");
196       FastaStreamSequence fastaStreamSequence0 = new FastaStreamSequence("G~8c[YFB6lQ)E");
197       Bases bases0 = new Bases(fastaStreamSequence0);
198       fastaStreamSequence0.setFromChar(bases0.letter_index);
199       MarkerRange markerRange0 = basePattern0.findMatch(bases0, (Marker) null, 255, false, true, false);
200       assertTrue(markerRange0.isForwardMarker());
201   }
202 
203   @Test(timeout = 4000)
test21()204   public void test21()  throws Throwable  {
205       BasePattern basePattern0 = new BasePattern("r");
206       FastaStreamSequence fastaStreamSequence0 = new FastaStreamSequence("G~8c[YFB6lQ)E");
207       Bases bases0 = new Bases(fastaStreamSequence0);
208       fastaStreamSequence0.setFromChar(bases0.letter_index);
209       MarkerRange markerRange0 = basePattern0.findMatch(bases0, (Marker) null, (-2154), false, true, true);
210       assertNull(markerRange0);
211   }
212 
213   @Test(timeout = 4000)
test22()214   public void test22()  throws Throwable  {
215       BasePattern basePattern0 = new BasePattern("K");
216       String string0 = basePattern0.toString();
217       assertEquals("k", string0);
218   }
219 
220   @Test(timeout = 4000)
test23()221   public void test23()  throws Throwable  {
222       BasePattern basePattern0 = null;
223       try {
224         basePattern0 = new BasePattern("yFW`j?WCz]g");
225         fail("Expecting exception: Exception");
226 
227       } catch(Throwable e) {
228          //
229          // illegal characters in pattern
230          //
231          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
232       }
233   }
234 
235   @Test(timeout = 4000)
test24()236   public void test24()  throws Throwable  {
237       BasePattern basePattern0 = null;
238       try {
239         basePattern0 = new BasePattern("RwqM4c)_udAnilv");
240         fail("Expecting exception: Exception");
241 
242       } catch(Throwable e) {
243          //
244          // illegal characters in pattern
245          //
246          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
247       }
248   }
249 
250   @Test(timeout = 4000)
test25()251   public void test25()  throws Throwable  {
252       BasePattern basePattern0 = null;
253       try {
254         basePattern0 = new BasePattern("The targetted ontology may not be null");
255         fail("Expecting exception: Exception");
256 
257       } catch(Throwable e) {
258          //
259          // illegal characters in pattern
260          //
261          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
262       }
263   }
264 
265   @Test(timeout = 4000)
test26()266   public void test26()  throws Throwable  {
267       BasePattern basePattern0 = null;
268       try {
269         basePattern0 = new BasePattern("j#I.lO_B");
270         fail("Expecting exception: Exception");
271 
272       } catch(Throwable e) {
273          //
274          // illegal characters in pattern
275          //
276          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
277       }
278   }
279 
280   @Test(timeout = 4000)
test27()281   public void test27()  throws Throwable  {
282       BasePattern basePattern0 = null;
283       try {
284         basePattern0 = new BasePattern("VI#_-kT/");
285         fail("Expecting exception: Exception");
286 
287       } catch(Throwable e) {
288          //
289          // illegal characters in pattern
290          //
291          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
292       }
293   }
294 
295   @Test(timeout = 4000)
test28()296   public void test28()  throws Throwable  {
297       int int0 = BasePattern.patternType("enO}");
298       assertEquals((-1), int0);
299   }
300 
301   @Test(timeout = 4000)
test29()302   public void test29()  throws Throwable  {
303       BasePattern basePattern0 = null;
304       try {
305         basePattern0 = new BasePattern("do^I#_X");
306         fail("Expecting exception: Exception");
307 
308       } catch(Throwable e) {
309          //
310          // illegal characters in pattern
311          //
312          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
313       }
314   }
315 
316   @Test(timeout = 4000)
test30()317   public void test30()  throws Throwable  {
318       int int0 = BasePattern.patternType("c[:");
319       assertEquals((-1), int0);
320   }
321 
322   @Test(timeout = 4000)
test31()323   public void test31()  throws Throwable  {
324       BasePattern basePattern0 = null;
325       try {
326         basePattern0 = new BasePattern("Bl/;]<^UU&N!");
327         fail("Expecting exception: Exception");
328 
329       } catch(Throwable e) {
330          //
331          // illegal characters in pattern
332          //
333          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
334       }
335   }
336 
337   @Test(timeout = 4000)
test32()338   public void test32()  throws Throwable  {
339       BasePattern basePattern0 = null;
340       try {
341         basePattern0 = new BasePattern("NKax7G");
342         fail("Expecting exception: Exception");
343 
344       } catch(Throwable e) {
345          //
346          // illegal characters in pattern
347          //
348          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
349       }
350   }
351 
352   @Test(timeout = 4000)
test33()353   public void test33()  throws Throwable  {
354       BasePattern basePattern0 = new BasePattern("g");
355       FastaStreamSequence fastaStreamSequence0 = new FastaStreamSequence("G~8c[YFB6lQ)E");
356       Bases bases0 = new Bases(fastaStreamSequence0);
357       MarkerRangeVector markerRangeVector0 = basePattern0.findMatches(bases0, (Marker) null, 1011);
358       assertEquals(1, markerRangeVector0.size());
359   }
360 
361   @Test(timeout = 4000)
test34()362   public void test34()  throws Throwable  {
363       BasePattern basePattern0 = new BasePattern("g");
364       FastaStreamSequence fastaStreamSequence0 = new FastaStreamSequence("G~8c[YFB6lQ)E");
365       Bases bases0 = new Bases(fastaStreamSequence0);
366       MarkerRange markerRange0 = basePattern0.findMatch(bases0, (Marker) null, 255, true, true, true);
367       assertNotNull(markerRange0);
368       assertFalse(markerRange0.isForwardMarker());
369   }
370 
371   @Test(timeout = 4000)
test35()372   public void test35()  throws Throwable  {
373       BasePattern basePattern0 = new BasePattern("r");
374       FastaStreamSequence fastaStreamSequence0 = new FastaStreamSequence("G~8c[YFB6lQ)E");
375       Bases bases0 = new Bases(fastaStreamSequence0);
376       MarkerRange markerRange0 = basePattern0.findMatch(bases0, (Marker) null, (-2154), false, true, true);
377       assertNull(markerRange0);
378   }
379 
380   @Test(timeout = 4000)
test36()381   public void test36()  throws Throwable  {
382       BasePattern basePattern0 = new BasePattern("hr");
383       FastaStreamSequence fastaStreamSequence0 = new FastaStreamSequence("G~8c[YFB6lQ)E");
384       Bases bases0 = new Bases(fastaStreamSequence0);
385       fastaStreamSequence0.setFromChar(bases0.letter_index);
386       MarkerRangeVector markerRangeVector0 = basePattern0.findMatches(bases0, (Marker) null, 968);
387       assertEquals(3, markerRangeVector0.size());
388   }
389 
390   @Test(timeout = 4000)
test37()391   public void test37()  throws Throwable  {
392       BasePattern basePattern0 = new BasePattern("r");
393       FastaStreamSequence fastaStreamSequence0 = new FastaStreamSequence("G~8c[YFB6lQ)E");
394       Bases bases0 = new Bases(fastaStreamSequence0);
395       fastaStreamSequence0.setFromChar(bases0.letter_index);
396       MarkerRange markerRange0 = basePattern0.findMatch(bases0, (Marker) null, 255, true, true, true);
397       assertTrue(markerRange0.isForwardMarker());
398       assertNotNull(markerRange0);
399   }
400 
401   @Test(timeout = 4000)
test38()402   public void test38()  throws Throwable  {
403       BasePattern basePattern0 = new BasePattern("r");
404       FastaStreamSequence fastaStreamSequence0 = new FastaStreamSequence("G~8c[YFB6lQ)E");
405       Bases bases0 = new Bases(fastaStreamSequence0);
406       MarkerRange markerRange0 = basePattern0.findMatch(bases0, (Marker) null, (-2154), false, false, false);
407       assertNull(markerRange0);
408   }
409 
410   @Test(timeout = 4000)
test39()411   public void test39()  throws Throwable  {
412       BasePattern basePattern0 = new BasePattern("N");
413       boolean boolean0 = basePattern0.matches("N");
414       assertTrue(boolean0);
415   }
416 
417   @Test(timeout = 4000)
test40()418   public void test40()  throws Throwable  {
419       BasePattern basePattern0 = new BasePattern("r");
420       boolean boolean0 = basePattern0.matches("uk.ac.sanger.artemis.sequence.BasePattern");
421       assertFalse(boolean0);
422   }
423 
424   @Test(timeout = 4000)
test41()425   public void test41()  throws Throwable  {
426       BasePattern basePattern0 = null;
427       try {
428         basePattern0 = new BasePattern("");
429         fail("Expecting exception: Exception");
430 
431       } catch(Throwable e) {
432          //
433          // pattern too short
434          //
435          verifyException("uk.ac.sanger.artemis.sequence.BasePattern", e);
436       }
437   }
438 }
439