(no commit message)
[cdmlib.git] / libraryTesterApplication / src / Profiling.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10
11 import java.util.List;
12 import java.util.UUID;
13
14 import org.apache.log4j.Logger;
15
16 import eu.etaxonomy.cdm.api.application.CdmApplicationController;
17 import eu.etaxonomy.cdm.database.DbSchemaValidation;
18 import eu.etaxonomy.cdm.database.ICdmDataSource;
19 import eu.etaxonomy.cdm.model.reference.ReferenceBase;
20 import eu.etaxonomy.cdm.model.taxon.Taxon;
21
22 /**
23 * @author a.mueller
24 * @created 03.06.2008
25 * @version 1.0
26 */
27 public class Profiling {
28 private static final Logger logger = Logger.getLogger(Profiling.class);
29
30 private void testGetRoot(){
31 System.out.println("testGetRoot started ...");
32 ICdmDataSource cdmDestination = CdmDestinations.cdm_edit_cichorieae();
33 DbSchemaValidation val = DbSchemaValidation.VALIDATE;
34 try {
35 CdmApplicationController app = CdmApplicationController.NewInstance(cdmDestination, val);
36 System.out.println("app initialized ...");
37 String secUuid = "cd31b368-7c5c-47ac-ba51-647205f1450d";
38 ReferenceBase sec = app.getReferenceService().getReferenceByUuid(UUID.fromString(secUuid));
39 List<Taxon> roots = app.getTaxonService().getRootTaxa(sec, null, true);
40 for (Taxon taxon: roots){
41 System.out.println("Taxon: " + taxon.getUuid() + ", " + taxon.getTitleCache());
42 }
43 } catch (Exception e) {
44 e.printStackTrace();
45 }
46 System.out.println("testGetRoot ended ...");
47 }
48
49
50 /**
51 * @param args
52 */
53 public static void main(String[] args) {
54 Profiling me = new Profiling();
55 me.testGetRoot();
56 }
57 }