Adapt cdmlib-persistence to new testing architecture #5370
[cdmlib.git] / cdmlib-test / src / main / java / eu / etaxonomy / cdm / test / integration / CdmTransactionalIntegrationTestExample.java
1 //// $Id$
2 ///**
3 //* Copyright (C) 2015 EDIT
4 //* European Distributed Institute of Taxonomy
5 //* http://www.e-taxonomy.eu
6 //*
7 //* The contents of this file are subject to the Mozilla Public License Version 1.1
8 //* See LICENSE.TXT at the top of this package for the full license terms.
9 //*/
10 //package eu.etaxonomy.cdm.test.integration;
11 //
12 //import java.io.FileNotFoundException;
13 //import java.util.UUID;
14 //
15 //import org.unitils.dbunit.annotation.DataSet;
16 //import org.unitils.spring.annotation.SpringBeanByType;
17 //
18 //import eu.etaxonomy.cdm.model.reference.Reference;
19 //import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
20 //import eu.etaxonomy.cdm.model.taxon.Classification;
21 //import eu.etaxonomy.cdm.persistence.dao.reference.IReferenceDao;
22 //import eu.etaxonomy.cdm.persistence.dao.taxon.IClassificationDao;
23 //import eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonDao;
24 //import eu.etaxonomy.cdm.test.unitils.CleanSweepInsertLoadStrategy;
25 //
26 ///**
27 // * This is only an example for am implementation of the {@link CdmTransactionalIntegrationTest}
28 // * which is never meant to be executed.
29 // *
30 // * @author a.kohlbecker
31 // * @date Jun 15, 2015
32 // *
33 // */
34 //public class CdmTransactionalIntegrationTestExample extends CdmTransactionalIntegrationTest {
35 //
36 // @SpringBeanByType
37 // private ITaxonDao taxonDao;
38 // @SpringBeanByType
39 // private IClassificationDao classificationDao;
40 // @SpringBeanByType
41 // private IReferenceDao referenceDao;
42 //
43 // private static final String CLASSIFICATION_UUID = "2a5ceebb-4830-4524-b330-78461bf8cb6b";
44 //
45 // /**
46 // * This is an example implementation for {@link CdmTransactionalIntegrationTest#createTestDataSet()}:
47 // *
48 // * {@inheritDoc}
49 // */
50 // @Override
51 // // @Test // uncomment to write out the test data xml file for this test class
52 // @DataSet(loadStrategy=CleanSweepInsertLoadStrategy.class, value="/eu/etaxonomy/cdm/database/ClearDBDataSet.xml")
53 // public final void createTestDataSet() throws FileNotFoundException {
54 //
55 // // 1. create the entities and save them
56 // Classification europeanAbiesClassification = Classification.NewInstance("European Abies");
57 // europeanAbiesClassification.setUuid(UUID.fromString(CLASSIFICATION_UUID));
58 // classificationDao.save(europeanAbiesClassification);
59 //
60 // Reference<?> sec = ReferenceFactory.newBook();
61 // sec.setTitleCache("Kohlbecker, A., Testcase standart views, 2013", true);
62 // Reference<?> sec_sensu = ReferenceFactory.newBook();
63 // sec_sensu.setTitleCache("Komarov, V. L., Flora SSSR 29", true);
64 // referenceDao.save(sec);
65 // referenceDao.save(sec_sensu);
66 //
67 // // 2. end the transaction so that all data is actually written to the db
68 // setComplete();
69 // endTransaction();
70 //
71 // // use the fileNameAppendix if you are creating a data set file which need to be named differently
72 // // from the standard name. For example if a single test method needs different data then the other
73 // // methods the test class you may want to set the fileNameAppendix when creating the data for this method.
74 // String fileNameAppendix = null;
75 //
76 // // 3.
77 // writeDbUnitDataSetFile(new String[] {
78 // "TAXONBASE", "TAXONNAMEBASE",
79 // "SYNONYMRELATIONSHIP", "TAXONRELATIONSHIP",
80 // "REFERENCE",
81 // "AGENTBASE", "HOMOTYPICALGROUP",
82 // "CLASSIFICATION", "TAXONNODE",
83 // "HIBERNATE_SEQUENCES" // IMPORTANT!!!
84 // },
85 // fileNameAppendix );
86 // }
87 //
88 //}