Revision 55d84577
Added by Andreas Kohlbecker over 12 years ago
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/taxon/TaxonDaoHibernateImplBenchmark.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import static junit.framework.Assert.assertNotNull; |
13 | 13 |
|
14 |
import java.util.ArrayList; |
|
15 |
import java.util.List; |
|
16 | 14 |
import java.util.UUID; |
17 | 15 |
|
18 | 16 |
import org.junit.After; |
... | ... | |
22 | 20 |
import org.unitils.spring.annotation.SpringBeanByType; |
23 | 21 |
|
24 | 22 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
25 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
|
26 |
import eu.etaxonomy.cdm.model.view.AuditEvent; |
|
27 | 23 |
import eu.etaxonomy.cdm.model.view.context.AuditEventContextHolder; |
28 | 24 |
import eu.etaxonomy.cdm.persistence.dao.common.IDefinedTermDao; |
29 | 25 |
import eu.etaxonomy.cdm.persistence.dao.reference.IReferenceDao; |
30 |
import eu.etaxonomy.cdm.persistence.dao.taxon.IClassificationDao; |
|
31 | 26 |
import eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonDao; |
32 | 27 |
import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest; |
33 | 28 |
|
... | ... | |
45 | 40 |
@SpringBeanByType |
46 | 41 |
private ITaxonDao taxonDao; |
47 | 42 |
|
48 |
@SpringBeanByType |
|
49 |
private IClassificationDao classificationDao; |
|
50 | 43 |
|
51 | 44 |
@SpringBeanByType |
52 | 45 |
private IReferenceDao referenceDao; |
... | ... | |
54 | 47 |
@SpringBeanByType |
55 | 48 |
IDefinedTermDao definedTermDao; |
56 | 49 |
|
57 |
private UUID uuid; |
|
58 |
private UUID sphingidae; |
|
59 |
private UUID acherontia; |
|
60 |
private UUID mimas; |
|
61 |
private UUID rethera; |
|
62 |
private UUID retheraSecCdmtest; |
|
63 |
private UUID atroposAgassiz; |
|
64 |
private UUID atroposLeach; |
|
65 | 50 |
private UUID acherontiaLachesis; |
66 |
private AuditEvent previousAuditEvent; |
|
67 |
private AuditEvent mostRecentAuditEvent; |
|
68 |
|
|
69 |
private UUID northernAmericaUuid; |
|
70 |
private UUID southernAmericaUuid; |
|
71 |
private UUID antarcticaUuid; |
|
72 |
|
|
73 |
private UUID classificationUuid; |
|
74 |
|
|
75 |
private Taxon taxonAcherontia; |
|
76 | 51 |
|
77 | 52 |
private static final int BENCHMARK_ROUNDS = 20; |
78 | 53 |
|
79 | 54 |
@Before |
80 | 55 |
public void setUp() { |
81 |
|
|
82 |
uuid = UUID.fromString("496b1325-be50-4b0a-9aa2-3ecd610215f2"); |
|
83 |
sphingidae = UUID.fromString("54e767ee-894e-4540-a758-f906ecb4e2d9"); |
|
84 |
acherontia = UUID.fromString("c5cc8674-4242-49a4-aada-72d63194f5fa"); |
|
85 | 56 |
acherontiaLachesis = UUID.fromString("b04cc9cb-2b4a-4cc4-a94a-3c93a2158b06"); |
86 |
atroposAgassiz = UUID.fromString("d75b2e3d-7394-4ada-b6a5-93175b8751c1"); |
|
87 |
atroposLeach = UUID.fromString("3da4ab34-6c50-4586-801e-732615899b07"); |
|
88 |
rethera = UUID.fromString("a9f42927-e507-4fda-9629-62073a908aae"); |
|
89 |
retheraSecCdmtest = UUID.fromString("a9f42927-e507-433a-9629-62073a908aae"); |
|
90 |
|
|
91 |
|
|
92 |
mimas = UUID.fromString("900052b7-b69c-4e26-a8f0-01c215214c40"); |
|
93 |
previousAuditEvent = new AuditEvent(); |
|
94 |
previousAuditEvent.setRevisionNumber(1025); |
|
95 |
previousAuditEvent.setUuid(UUID.fromString("a680fab4-365e-4765-b49e-768f2ee30cda")); |
|
96 |
mostRecentAuditEvent = new AuditEvent(); |
|
97 |
mostRecentAuditEvent.setRevisionNumber(1026); |
|
98 |
mostRecentAuditEvent.setUuid(UUID.fromString("afe8e761-8545-497b-9134-6a6791fc0b0d")); |
|
99 |
AuditEventContextHolder.clearContext(); // By default we're in the current view (i.e. view == null) |
|
100 |
|
|
101 |
northernAmericaUuid = UUID.fromString("2757e726-d897-4546-93bd-7951d203bf6f"); |
|
102 |
southernAmericaUuid = UUID.fromString("6310b3ba-96f4-4855-bb5b-326e7af188ea"); |
|
103 |
antarcticaUuid = UUID.fromString("791b3aa0-54dd-4bed-9b68-56b4680aad0c"); |
|
104 |
|
|
105 |
classificationUuid = UUID.fromString("aeee7448-5298-4991-b724-8d5b75a0a7a9"); |
|
106 |
|
|
107 |
taxonAcherontia = (Taxon)taxonDao.findByUuid(acherontia); |
|
108 | 57 |
} |
109 | 58 |
|
110 | 59 |
@After |
Also available in: Unified diff
benchmark for add character with states