1 /*
2  * This file was automatically generated by EvoSuite
3  * Fri Jan 12 10:29:27 GMT 2018
4  */
5 
6 package uk.ac.sanger.artemis.chado;
7 
8 import org.junit.Test;
9 import static org.junit.Assert.*;
10 import static org.evosuite.runtime.EvoAssertions.*;
11 import java.util.Vector;
12 import org.evosuite.runtime.EvoRunner;
13 import org.evosuite.runtime.EvoRunnerParameters;
14 import org.gmod.schema.cv.CvTerm;
15 import org.junit.runner.RunWith;
16 import uk.ac.sanger.artemis.Entry;
17 import uk.ac.sanger.artemis.EntryChangeEvent;
18 import uk.ac.sanger.artemis.SimpleEntryGroup;
19 import uk.ac.sanger.artemis.chado.ChadoTransactionManager;
20 import uk.ac.sanger.artemis.io.GFFStreamFeature;
21 import uk.ac.sanger.artemis.io.Range;
22 import uk.ac.sanger.artemis.sequence.SequenceChangeEvent;
23 
24 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
25 public class ChadoTransactionManager_ESTest extends ChadoTransactionManager_ESTest_scaffolding {
26 
27   @Test(timeout = 4000)
test00()28   public void test00()  throws Throwable  {
29       // Undeclared exception!
30       try {
31         ChadoTransactionManager.isCvTag((String) null);
32         fail("Expecting exception: NullPointerException");
33 
34       } catch(NullPointerException e) {
35       }
36   }
37 
38   @Test(timeout = 4000)
test01()39   public void test01()  throws Throwable  {
40       // Undeclared exception!
41       try {
42         ChadoTransactionManager.isSynonymTag(" is not a valid qualifier!", (GFFStreamFeature) null);
43         fail("Expecting exception: NullPointerException");
44 
45       } catch(NullPointerException e) {
46          //
47          // no message in exception (getMessage() returned null)
48          //
49          verifyException("uk.ac.sanger.artemis.components.genebuilder.GeneUtils", e);
50       }
51   }
52 
53   @Test(timeout = 4000)
test02()54   public void test02()  throws Throwable  {
55       ChadoTransactionManager chadoTransactionManager0 = new ChadoTransactionManager();
56       boolean boolean0 = chadoTransactionManager0.hasTransactions();
57       assertFalse(boolean0);
58   }
59 
60   @Test(timeout = 4000)
test03()61   public void test03()  throws Throwable  {
62       ChadoTransactionManager chadoTransactionManager0 = new ChadoTransactionManager();
63       Vector<String> vector0 = chadoTransactionManager0.getFeatureInsertUpdate();
64       assertNull(vector0);
65   }
66 
67   @Test(timeout = 4000)
test04()68   public void test04()  throws Throwable  {
69       CvTerm cvTerm0 = ChadoTransactionManager.getCvTerm("BLabrAP]:z6Fph?k", "GKEhcB!SPM9", "", "BLabrAP]:z6Fph?k");
70       assertEquals("BLabrAP]:z6Fph?k", cvTerm0.getName());
71   }
72 
73   @Test(timeout = 4000)
test05()74   public void test05()  throws Throwable  {
75       CvTerm cvTerm0 = ChadoTransactionManager.getCvTerm("", "CCGEN", "BVpn>b+'vY", "2o{S0fD~hO");
76       assertEquals("BVpn>b+'vY", cvTerm0.getDefinition());
77       assertEquals("", cvTerm0.getName());
78   }
79 
80   @Test(timeout = 4000)
test06()81   public void test06()  throws Throwable  {
82       CvTerm cvTerm0 = ChadoTransactionManager.getCvTerm("  in handleReservedTags() DELETE db=", "8sl-\"QI<:l3", (String) null, (String) null);
83       assertEquals("  in handleReservedTags() DELETE db=", cvTerm0.getName());
84   }
85 
86   @Test(timeout = 4000)
test07()87   public void test07()  throws Throwable  {
88       boolean boolean0 = ChadoTransactionManager.isCvTag("COMMIT DONE ");
89       assertFalse(boolean0);
90   }
91 
92   @Test(timeout = 4000)
test08()93   public void test08()  throws Throwable  {
94       // Undeclared exception!
95       try {
96         ChadoTransactionManager.isSpecialTag("}~!EME\"");
97         fail("Expecting exception: NullPointerException");
98 
99       } catch(NullPointerException e) {
100          //
101          // no message in exception (getMessage() returned null)
102          //
103          verifyException("uk.ac.sanger.artemis.components.genebuilder.GeneUtils", e);
104       }
105   }
106 
107   @Test(timeout = 4000)
test09()108   public void test09()  throws Throwable  {
109       ChadoTransactionManager chadoTransactionManager0 = new ChadoTransactionManager();
110       EntryChangeEvent entryChangeEvent0 = new EntryChangeEvent(chadoTransactionManager0, (Entry) null, 0);
111       chadoTransactionManager0.entryChanged(entryChangeEvent0);
112       assertEquals(1, EntryChangeEvent.FEATURE_DELETED);
113   }
114 
115   @Test(timeout = 4000)
test10()116   public void test10()  throws Throwable  {
117       ChadoTransactionManager chadoTransactionManager0 = new ChadoTransactionManager();
118       Range range0 = new Range(899);
119       SequenceChangeEvent sequenceChangeEvent0 = new SequenceChangeEvent(899, 58, range0);
120       chadoTransactionManager0.sequenceChanged(sequenceChangeEvent0);
121       assertEquals(4, SequenceChangeEvent.CONTIG_REVERSE_COMPLEMENT);
122   }
123 
124   @Test(timeout = 4000)
test11()125   public void test11()  throws Throwable  {
126       ChadoTransactionManager chadoTransactionManager0 = new ChadoTransactionManager();
127       Range range0 = new Range((-639));
128       SequenceChangeEvent sequenceChangeEvent0 = new SequenceChangeEvent((byte)1, (byte)9, range0);
129       // Undeclared exception!
130       try {
131         chadoTransactionManager0.sequenceChanged(sequenceChangeEvent0);
132         fail("Expecting exception: NullPointerException");
133 
134       } catch(NullPointerException e) {
135          //
136          // no message in exception (getMessage() returned null)
137          //
138          verifyException("uk.ac.sanger.artemis.chado.ChadoTransactionManager", e);
139       }
140   }
141 
142   @Test(timeout = 4000)
test12()143   public void test12()  throws Throwable  {
144       ChadoTransactionManager chadoTransactionManager0 = new ChadoTransactionManager();
145       int int0 = chadoTransactionManager0.getCommitReturnValue();
146       assertEquals(0, int0);
147   }
148 
149   @Test(timeout = 4000)
test13()150   public void test13()  throws Throwable  {
151       ChadoTransactionManager chadoTransactionManager0 = new ChadoTransactionManager();
152       // Undeclared exception!
153       try {
154         chadoTransactionManager0.getTransactionAt((-142));
155         fail("Expecting exception: ArrayIndexOutOfBoundsException");
156 
157       } catch(ArrayIndexOutOfBoundsException e) {
158          //
159          // no message in exception (getMessage() returned null)
160          //
161       }
162   }
163 
164   @Test(timeout = 4000)
test14()165   public void test14()  throws Throwable  {
166       String[] stringArray0 = ChadoTransactionManager.getSynonymTags();
167       assertNull(stringArray0);
168   }
169 
170   @Test(timeout = 4000)
test15()171   public void test15()  throws Throwable  {
172       ChadoTransactionManager chadoTransactionManager0 = new ChadoTransactionManager();
173       int int0 = chadoTransactionManager0.getTransactionCount();
174       assertEquals(0, int0);
175   }
176 
177   @Test(timeout = 4000)
test16()178   public void test16()  throws Throwable  {
179       ChadoTransactionManager chadoTransactionManager0 = new ChadoTransactionManager();
180       SimpleEntryGroup simpleEntryGroup0 = new SimpleEntryGroup();
181       chadoTransactionManager0.setEntryGroup(simpleEntryGroup0);
182       assertEquals(0, simpleEntryGroup0.size());
183   }
184 }
185