Project

General

Profile

« Previous | Next » 

Revision f399aa02

Added by Cherian Mathew almost 9 years ago

corrected / moved existing tests

View differences:

.gitattributes
1854 1854
eu.etaxonomy.taxeditor.test/META-INF/MANIFEST.MF -text
1855 1855
eu.etaxonomy.taxeditor.test/build.properties -text
1856 1856
eu.etaxonomy.taxeditor.test/ide/eclipse/EDITor[!!-~]Tests.launch -text
1857
eu.etaxonomy.taxeditor.test/lib/byte-buddy-0.5.1.jar -text
1857 1858
eu.etaxonomy.taxeditor.test/pom.xml -text
1858 1859
eu.etaxonomy.taxeditor.test/src/main/resources/cdmlib-ehcache.xml -text
1859 1860
eu.etaxonomy.taxeditor.test/src/main/resources/datasources.xml -text
1860 1861
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.xml -text
1861 1862
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/cdm.datasources.xml -text
1862 1863
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/PolytomousKeyTest.xml -text
1863
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/TaxonNodeTest.xml -text
1864
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/TaxonNameEditorTest.xml -text
1865
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/TaxonNavigatorTest.xml -text
1864 1866
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/testRemotingApplicationContext.xml -text
1865 1867
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.xml -text
1866 1868
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/taxeditor/lazyloading/CdmEntityCacherTest.xml -text
......
1873 1875
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.java -text
1874 1876
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmModelGetMethodCacherTest.java -text
1875 1877
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/PolytomousKeyTest.java -text
1876
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/TaxonNodeTest.java -text
1878
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/TaxonNameEditorTest.java -text
1879
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/TaxonNavigatorTest.java -text
1877 1880
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/application/menu/general/NewMenuTest.java -text
1878 1881
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java -text
1879 1882
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CDMServer.java -text
......
1889 1892
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/RemotePersistentCollectionTest.java -text
1890 1893
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/navigation/navigator/contextmenu/ClassificationTest.java -text
1891 1894
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizardTest.java -text
1895
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operations/OperationTestBase.java -text
1892 1896
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ITestService.java -text
1893 1897
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceInterceptorTest.java -text
1894 1898
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceRebasingTest.java -text
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/TaxonNameEditorTest.xml
1
<?xml version="1.0" encoding="UTF-8"?><!--
2
  generated by Jailer 4.3, Wed Mar 04 16:11:14 CET 2015 from cmathew@cmbgbm-t530
3
  
4
  Extraction Model:  all rows from Classification (extractionmodel/by-example/SbE-Classification-16-11-06-737.csv)
5
  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
6
  Database User:     root
7
  
8
  Exported Rows:     31
9
      Classification                 1
10
      HomotypicalGroup               2
11
      SynonymRelationship            1
12
      TaxonBase                      5
13
      TaxonNameBase                  3
14
      TaxonNode                      19
15
  
16
--><dataset>
17
  
18
  
19
  <TaxonNode id="347" created="2010-12-21 15:09:45.0" uuid="d425a971-1abe-4895-9e1f-1e5c8ff1c84c" countchildren="0"  classification_id="10"  taxon_id="387" treeIndex="#t10#4032#49#346#345#347#" sortIndex="1"/>  
20
  <TaxonNode id="351" created="2010-12-21 15:09:46.0" uuid="ce54c396-3694-47f2-abb0-1d7b7e057985" countchildren="0"  classification_id="10"  taxon_id="394" treeIndex="#t10#4032#49#346#345#351#" sortIndex="4"/>
21
  
22
  <HomotypicalGroup id="368" created="2010-12-21 15:09:45.0" uuid="d7eaa174-4efd-4d09-a427-dce4ed6513f7" />
23
  <HomotypicalGroup id="375" created="2010-12-21 15:09:46.0" uuid="62ed57d6-2c69-4404-bb95-248a1c9bb24c" />
24

  
25
  <TaxonNameBase DTYPE="BotanicalName" id="387" created="2010-12-21 15:09:45.0" uuid="d25985c7-6fb4-4b31-8a94-5d7c5ba6ad16" protectedtitlecache="false" titleCache="Asplenium ceterach L." fullTitleCache="Asplenium ceterach L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Asplenium" hybridformula="false" monomhybrid="false" namecache="Asplenium ceterach" protectedauthorshipcache="false" protectednamecache="false" specificepithet="ceterach" trinomhybrid="false" anamorphic="false"  homotypicalgroup_id="368" rank_id="778" />
26
  <TaxonNameBase DTYPE="BotanicalName" id="388" created="2010-12-21 15:09:45.0" uuid="747021f1-cf5f-4249-a825-228da3368399" protectedtitlecache="true" titleCache="Asplenium cyprium Viane &amp; Van den heede" fullTitleCache="Asplenium cyprium Viane &amp; Van den heede" parsingproblem="16" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" hybridformula="false" monomhybrid="false" namecache="Asplenium cyprium Viane &amp; Van den heede" protectedauthorshipcache="false" protectednamecache="true" trinomhybrid="false" anamorphic="false" />
27
  <TaxonNameBase DTYPE="BotanicalName" id="394" created="2010-12-21 15:09:46.0" uuid="08f8f376-c9a4-4ea9-950d-3ac30b7fa689" protectedtitlecache="false" titleCache="Asplenium viride Huds." fullTitleCache="Asplenium viride Huds." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="Huds." binomhybrid="false" genusoruninomial="Asplenium" hybridformula="false" monomhybrid="false" namecache="Asplenium viride" protectedauthorshipcache="false" protectednamecache="false" specificepithet="viride" trinomhybrid="false" anamorphic="false"  homotypicalgroup_id="375" rank_id="778" />
28

  
29
  <Classification id="10" created="2010-12-21 15:09:43.0" uuid="0c2b5d25-7b15-4401-8b51-dd4be0ee5cab" protectedtitlecache="false" titleCache="Cyprus"  name_id="10" reference_id="10" />
30
 
31
  <TaxonBase DTYPE="Taxon" id="387" created="2011-03-01 20:11:27.0" uuid="9763e5f0-6cd4-4d96-b8a4-4420854f7727" protectedtitlecache="false" titleCache="Asplenium ceterach L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"  name_id="387" sec_id="10" publish="true"/>
32
  <TaxonBase DTYPE="Synonym" id="388" created="2010-12-21 15:09:45.0" uuid="1eb173bd-b174-4162-8ff5-5136d8f1e746" protectedtitlecache="false" titleCache="Asplenium cyprium Viane &amp; Van den heede sec. Cyprus" doubtful="false" usenamecache="false"  name_id="388" sec_id="10" publish="true"/>
33
  <TaxonBase DTYPE="Taxon" id="394" created="2011-03-01 20:11:27.0" uuid="aff4fa6f-9aa8-463d-ac07-ec8a1925eb57" protectedtitlecache="false" titleCache="Asplenium viride Huds. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"  name_id="394" sec_id="10" publish="true"/>
34

  
35
  <SynonymRelationship id="50" created="2010-12-21 15:09:45.0" uuid="60d1466f-5823-4a69-a071-1887d0c1e72b" doubtful="false" partial="false" proparte="false"  relatedfrom_id="388" relatedto_id="387" />
36

  
37
  
38
</dataset>
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/TaxonNavigatorTest.xml
1
<?xml version="1.0" encoding="UTF-8"?><!--
2
  generated by Jailer 4.3, Mon Mar 09 12:52:22 CET 2015 from cmathew@cmbgbm-t530
3
  
4
  Extraction Model:  all rows from Classification (extractionmodel/by-example/SbE-Classification-12-51-51-866.csv)
5
  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
6
  Database User:     root
7
  
8
  Exported Rows:     26
9
      Classification                 1
10
      TaxonBase                      6
11
      TaxonNameBase                  6
12
      TaxonNode                      13
13
  
14
--><dataset>
15
  <TaxonNode id="13" created="2010-12-21 15:09:43.0" uuid="0ac32f24-6d55-44ae-8519-c86c83faa938" countchildren="122" createdby_id="11" classification_id="10" parent_id="4032" taxon_id="11" treeIndex="#t10#4032#13#" sortIndex="0"/>
16
  <TaxonNode id="49" created="2010-12-21 15:09:43.0" uuid="572290a9-7535-48c8-9f68-25ddbc9869ee" countchildren="10" createdby_id="11" classification_id="10" parent_id="4032" taxon_id="49" treeIndex="#t10#4032#49#" sortIndex="1"/>
17
  <TaxonNode id="344" created="2010-12-21 15:09:45.0" uuid="894bc754-235b-4fa1-aa0c-a2b62e3f684c" countchildren="0" createdby_id="11" classification_id="10" parent_id="345" taxon_id="384" treeIndex="#t10#4032#49#346#345#344#" sortIndex="0"/>
18
  <TaxonNode id="345" created="2010-12-21 15:09:45.0" uuid="8667c9d7-18e4-4711-a2be-9d468635744d" countchildren="5" createdby_id="11" classification_id="10" parent_id="346" taxon_id="386" treeIndex="#t10#4032#49#346#345#" sortIndex="0"/>
19
  <TaxonNode id="346" created="2010-12-21 15:09:45.0" uuid="ffc9b1ec-278e-4298-8bc2-d36bdb2c33b8" countchildren="1" createdby_id="11" classification_id="10" parent_id="49" taxon_id="385" treeIndex="#t10#4032#49#346#" sortIndex="1"/>
20
  <TaxonNode id="347" created="2010-12-21 15:09:45.0" uuid="d425a971-1abe-4895-9e1f-1e5c8ff1c84c" countchildren="0" createdby_id="11" classification_id="10" parent_id="345" taxon_id="387" treeIndex="#t10#4032#49#346#345#347#" sortIndex="1"/>
21
  <TaxonNode id="348" created="2010-12-21 15:09:46.0" uuid="3bb05d37-51fa-48f6-9f49-0162f2893dd5" countchildren="0" createdby_id="11" classification_id="10" parent_id="345" taxon_id="391" treeIndex="#t10#4032#49#346#345#348#" sortIndex="2"/>
22
  <TaxonNode id="350" created="2010-12-21 15:09:46.0" uuid="3f47c04f-4a84-4f53-95ce-840309900db7" countchildren="1" createdby_id="11" classification_id="10" parent_id="345" taxon_id="393" treeIndex="#t10#4032#49#346#345#350#" sortIndex="3"/>
23
  <TaxonNode id="351" created="2010-12-21 15:09:46.0" uuid="ce54c396-3694-47f2-abb0-1d7b7e057985" countchildren="0" createdby_id="11" classification_id="10" parent_id="345" taxon_id="394" treeIndex="#t10#4032#49#346#345#351#" sortIndex="4"/>
24
  <TaxonNode id="942" created="2010-12-21 15:09:50.0" uuid="713baf41-c76b-4ba6-be82-ffabb7f895c5" countchildren="0" createdby_id="11" classification_id="10" parent_id="943" taxon_id="1070" treeIndex="#t10#4032#49#3880#943#942#" sortIndex="0"/>
25
  <TaxonNode id="943" created="2010-12-21 15:09:50.0" uuid="47336df4-af4b-4b40-84de-34fc445d762c" countchildren="1" createdby_id="11" classification_id="10" parent_id="3880" taxon_id="1072" treeIndex="#t10#4032#49#3880#943#" sortIndex="0"/>
26
  <TaxonNode id="3880" created="2012-07-19 21:43:16.0" uuid="05102134-ce13-4a0e-be2e-48aa08ecbea5" countchildren="1" createdby_id="30" classification_id="10" parent_id="49" taxon_id="6110" treeIndex="#t10#4032#49#3880#" sortIndex="9"/>
27
  <TaxonNode id="4032" created="2014-01-16 10:24:29.0" uuid="29b3fd3f-29b4-4011-ab12-9c1ad1607dbd" countchildren="2" classification_id="10" treeIndex="#t10#4032#"/>
28

  
29
  <TaxonNameBase DTYPE="BotanicalName" id="384" created="2010-12-21 15:09:45.0" uuid="0a89c1d4-b8b9-4bbe-8e25-03cef7179b6d" protectedtitlecache="false" titleCache="Asplenium adiantum-nigrum L." fullTitleCache="Asplenium adiantum-nigrum L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Asplenium" hybridformula="false" monomhybrid="false" namecache="Asplenium adiantum-nigrum" protectedauthorshipcache="false" protectednamecache="false" specificepithet="adiantum-nigrum" trinomhybrid="false" anamorphic="false" createdby_id="11" homotypicalgroup_id="365" rank_id="778" combinationauthorteam_id="7220"/>
30
  <TaxonNameBase DTYPE="BotanicalName" id="387" created="2010-12-21 15:09:45.0" uuid="d25985c7-6fb4-4b31-8a94-5d7c5ba6ad16" protectedtitlecache="false" titleCache="Asplenium ceterach L." fullTitleCache="Asplenium ceterach L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Asplenium" hybridformula="false" monomhybrid="false" namecache="Asplenium ceterach" protectedauthorshipcache="false" protectednamecache="false" specificepithet="ceterach" trinomhybrid="false" anamorphic="false" createdby_id="11" homotypicalgroup_id="368" rank_id="778" combinationauthorteam_id="674"/>
31
  <TaxonNameBase DTYPE="BotanicalName" id="391" created="2010-12-21 15:09:46.0" uuid="bb33b929-77f4-47fd-ac6b-265e947871be" protectedtitlecache="false" titleCache="Asplenium onopteris L." fullTitleCache="Asplenium onopteris L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Asplenium" hybridformula="false" monomhybrid="false" namecache="Asplenium onopteris" protectedauthorshipcache="false" protectednamecache="false" specificepithet="onopteris" trinomhybrid="false" anamorphic="false" createdby_id="11" homotypicalgroup_id="372" rank_id="778" combinationauthorteam_id="678"/>
32
  <TaxonNameBase DTYPE="BotanicalName" id="393" created="2010-12-21 15:09:46.0" uuid="d0d8df45-6d47-4dbf-8554-ea1aa1e00dc9" protectedtitlecache="false" titleCache="Asplenium trichomanes L." fullTitleCache="Asplenium trichomanes L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Asplenium" hybridformula="false" monomhybrid="false" namecache="Asplenium trichomanes" protectedauthorshipcache="false" protectednamecache="false" specificepithet="trichomanes" trinomhybrid="false" anamorphic="false" createdby_id="11" homotypicalgroup_id="374" rank_id="778" combinationauthorteam_id="7390"/>
33
  <TaxonNameBase DTYPE="BotanicalName" id="394" created="2010-12-21 15:09:46.0" uuid="08f8f376-c9a4-4ea9-950d-3ac30b7fa689" protectedtitlecache="false" titleCache="Asplenium viride Huds." fullTitleCache="Asplenium viride Huds." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="Huds." binomhybrid="false" genusoruninomial="Asplenium" hybridformula="false" monomhybrid="false" namecache="Asplenium viride" protectedauthorshipcache="false" protectednamecache="false" specificepithet="viride" trinomhybrid="false" anamorphic="false" createdby_id="11" homotypicalgroup_id="375" rank_id="778" combinationauthorteam_id="682"/>
34
  <TaxonNameBase DTYPE="BotanicalName" id="1070" created="2010-12-21 15:09:50.0" uuid="d23fca33-18c6-4b5c-81d7-93359afd76e1" protectedtitlecache="false" titleCache="Cystopteris fragilis (L.) Bernh." fullTitleCache="Cystopteris fragilis (L.) Bernh." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(L.) Bernh." binomhybrid="false" genusoruninomial="Cystopteris" hybridformula="false" monomhybrid="false" namecache="Cystopteris fragilis" protectedauthorshipcache="false" protectednamecache="false" specificepithet="fragilis" trinomhybrid="false" anamorphic="false" createdby_id="11" homotypicalgroup_id="1004" rank_id="778" basionymauthorteam_id="2019" combinationauthorteam_id="2021"/>
35

  
36
  <Classification id="10" created="2010-12-21 15:09:43.0" uuid="0c2b5d25-7b15-4401-8b51-dd4be0ee5cab" protectedtitlecache="false" titleCache="Cyprus" createdby_id="11" name_id="10" reference_id="10" rootnode_id="4032"/>
37

  
38
  <TaxonBase DTYPE="Taxon" id="384" created="2011-03-01 20:11:27.0" uuid="b9f1429d-137c-4c23-a11f-7808b50bde4b" protectedtitlecache="false" titleCache="Asplenium adiantum-nigrum L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" name_id="384" sec_id="10" publish="true"/>
39
  <TaxonBase DTYPE="Taxon" id="387" created="2011-03-01 20:11:27.0" uuid="9763e5f0-6cd4-4d96-b8a4-4420854f7727" protectedtitlecache="false" titleCache="Asplenium ceterach L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" name_id="387" sec_id="10" publish="true"/>
40
  <TaxonBase DTYPE="Taxon" id="391" created="2011-03-01 20:11:27.0" uuid="42c42377-3847-4d85-811f-743ab3d3f0a3" protectedtitlecache="false" titleCache="Asplenium onopteris L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" name_id="391" sec_id="10" publish="true"/>
41
  <TaxonBase DTYPE="Taxon" id="393" created="2010-12-21 15:09:46.0" uuid="c1263710-0225-4429-b2b7-518e6db564c5" protectedtitlecache="false" titleCache="Asplenium trichomanes L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" name_id="393" sec_id="10" publish="true"/>
42
  <TaxonBase DTYPE="Taxon" id="394" created="2011-03-01 20:11:27.0" uuid="aff4fa6f-9aa8-463d-ac07-ec8a1925eb57" protectedtitlecache="false" titleCache="Asplenium viride Huds. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" name_id="394" sec_id="10" publish="true"/>
43
  <TaxonBase DTYPE="Taxon" id="1070" created="2011-03-01 20:11:30.0" uuid="f380f8ff-2dab-4ea7-a3c9-4758f963eb6b" protectedtitlecache="false" titleCache="Cystopteris fragilis (L.) Bernh. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" name_id="1070" sec_id="10" publish="true"/>
44

  
45
  
46
</dataset>
eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/TaxonNodeTest.xml
1
<?xml version='1.0' encoding='UTF-8'?>
2
<dataset>
3
    <REFERENCE ID="1" UUID="de7d1205-291f-45d9-9059-ca83fc7ade14" PROTECTEDTITLECACHE="false" REFTYPE="GEN" PROTECTEDABBREVTITLECACHE="false" ABBREVTITLECACHE="Sp. Pl." ABBREVTITLE="Sp. Pl." NOMENCLATURALLYRELEVANT="false" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" />
4
    <CLASSIFICATION ID="1" UUID="6c2bc8d9-ee62-4222-be89-4a8e31770878"  PROTECTEDTITLECACHE="true" ROOTNODE_ID = "1"/>
5
   <!-- <CLASSIFICATION_TAXONNODE CLASSIFICATION_ID="1" ROOTNODES_ID="1" SORTINDEX="0"/> --> 
6

  
7
    <TAXONNODE ID="1" TAXON_ID="[null]" PARENT_ID="[null]" SORTINDEX="[null]" CLASSIFICATION_ID="1" UUID="324a1a77-689c-44be-8e65-347d835f4111" COUNTCHILDREN="2" TREEINDEX="#t1#1#"/>
8
    <TAXONNODE ID="2" TAXON_ID="1" PARENT_ID="1" SORTINDEX="0" CLASSIFICATION_ID="1" UUID="484a1a77-689c-44be-8e65-347d835f47e8"  COUNTCHILDREN="0" TREEINDEX="#t1#1#2#"/>
9
    <TAXONNODE ID="3" TAXON_ID="2" PARENT_ID="1" SORTINDEX="1" CLASSIFICATION_ID="1" UUID="2d41f0c2-b785-4f73-a436-cc2d5e93cc5b"  COUNTCHILDREN="0" TREEINDEX="#t1#1#3#"/>
10

  
11
    <TAXONBASE DTYPE="Taxon" ID="1" NAME_ID="1" UUID="55c3e41a-c629-40e6-aa6a-ff274ac6ddb1"     PROTECTEDTITLECACHE="false" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="false" TAXONSTATUSUNKNOWN="false" UNPLACED="false" TAXONOMICCHILDRENCOUNT="0"/>
12
    <TAXONBASE DTYPE="Taxon" ID="2"  NAME_ID="2" UUID="2659a7e0-ff35-4ee4-8493-b453756ab955"    PROTECTEDTITLECACHE="false" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="false" TAXONSTATUSUNKNOWN="false" UNPLACED="false" TAXONOMICCHILDRENCOUNT="0"/>
13
    <TAXONBASE DTYPE="Synonym" ID="3" NAME_ID="3" UUID="3034249e-9491-4439-bcb6-9c7d68e29bce"   PROTECTEDTITLECACHE="false" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="[null]" TAXONSTATUSUNKNOWN="[null]" UNPLACED="[null]" TAXONOMICCHILDRENCOUNT="[null]"/>
14
    <TAXONBASE DTYPE="Synonym" ID="4" NAME_ID="4" UUID="ac6c5bb1-d36d-4068-af7c-4f0bb009880d"   PROTECTEDTITLECACHE="false" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="[null]" TAXONSTATUSUNKNOWN="[null]" UNPLACED="[null]" TAXONOMICCHILDRENCOUNT="[null]"/>
15

  
16
    <TAXONNAMEBASE DTYPE="BotanicalName" ID="1" UUID="54a1d7f9-79ab-4fb3-bff5-152e1046cf75" PROTECTEDTITLECACHE="false" PARSINGPROBLEM="0" HOMOTYPICALGROUP_ID="1" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="false" PROTECTEDAUTHORSHIPCACHE="false" PROTECTEDNAMECACHE="false" HYBRIDFORMULA="false" MONOMHYBRID="false" BINOMHYBRID="false" TRINOMHYBRID="false" ANAMORPHIC="false" RANK_ID="765"/>
17
    <TAXONNAMEBASE DTYPE="BotanicalName" ID="2" UUID="e7f50b04-9648-479b-bc8a-ffebf295dce9" PROTECTEDTITLECACHE="false" PARSINGPROBLEM="0" HOMOTYPICALGROUP_ID="2" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="false" PROTECTEDAUTHORSHIPCACHE="false" PROTECTEDNAMECACHE="false" HYBRIDFORMULA="false" MONOMHYBRID="false" BINOMHYBRID="false" TRINOMHYBRID="false" ANAMORPHIC="false" RANK_ID="765"/>
18
    <TAXONNAMEBASE DTYPE="BotanicalName" ID="3" UUID="c0439dd6-8d2b-4428-86f4-37f4a90d4583" PROTECTEDTITLECACHE="false" PARSINGPROBLEM="0" HOMOTYPICALGROUP_ID="3" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="false" PROTECTEDAUTHORSHIPCACHE="false" PROTECTEDNAMECACHE="false" HYBRIDFORMULA="false" MONOMHYBRID="false" BINOMHYBRID="false" TRINOMHYBRID="false" ANAMORPHIC="false" RANK_ID="765"/>
19
    <TAXONNAMEBASE DTYPE="BotanicalName" ID="4" UUID="6a5774bd-c8aa-42dc-91dd-d62d27e7ea2a" PROTECTEDTITLECACHE="false" PARSINGPROBLEM="0" HOMOTYPICALGROUP_ID="4" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="false" PROTECTEDAUTHORSHIPCACHE="false" PROTECTEDNAMECACHE="false" HYBRIDFORMULA="false" MONOMHYBRID="false" BINOMHYBRID="false" TRINOMHYBRID="false" ANAMORPHIC="false" RANK_ID="765"/>
20
    <HOMOTYPICALGROUP ID="1" CREATED="2011-10-12 19:57:31.0" UUID="d8652fa0-eff9-460d-8990-aed0ebf1322e"/>
21
    <HOMOTYPICALGROUP ID="2" CREATED="2011-10-12 19:57:31.0" UUID="2a1b0776-b4b5-462a-9be7-f88378ebd732"/>
22
    <HOMOTYPICALGROUP ID="3" CREATED="2011-10-12 19:57:31.0" UUID="3ac4e376-31cd-47fd-9dd6-eaff415ff0e7"/>
23
    <HOMOTYPICALGROUP ID="4" CREATED="2011-10-12 19:57:31.0" UUID="76258671-07cf-40f3-a9eb-af286b5945ec"/>
24

  
25
    <SYNONYMRELATIONSHIP ID="1" UUID="cc769418-3ba4-4c1f-a4cb-b18bf42ec8e9" CITATION_ID="1" RELATEDFROM_ID="3" RELATEDTO_ID="1" DOUBTFUL="false" PARTIAL="false" PROPARTE="false"/>
26
    <DESCRIPTIONBASE ID="1" UUID="56cf0c8c-18e3-4bea-9525-b9804cf57c5d" DTYPE="TaxonDescription" TAXON_ID="1" PROTECTEDTITLECACHE="false" IMAGEGALLERY="false" />
27
    <DESCRIPTIONBASE ID="2" UUID="36af5c7c-18e3-4bec-6535-a9804cf57c6e" DTYPE="TaxonDescription" TAXON_ID="1" PROTECTEDTITLECACHE="false" IMAGEGALLERY="false" />
28
    <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="1" INDESCRIPTION_ID="1" ORDERRELEVANT="false"/>
29
    <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="2" INDESCRIPTION_ID="2" ORDERRELEVANT="false"/>
30
    <DESCRIPTIONELEMENTBASE_LANGUAGESTRING DESCRIPTIONELEMENTBASE_ID="1" MULTILANGUAGETEXT_ID="1" MULTILANGUAGETEXT_MAPKEY_ID="406" />
31
    <DESCRIPTIONELEMENTBASE_LANGUAGESTRING DESCRIPTIONELEMENTBASE_ID="2" MULTILANGUAGETEXT_ID="2" MULTILANGUAGETEXT_MAPKEY_ID="406" />
32
    <LANGUAGESTRING ID="1" TEXT="Any text" LANGUAGE_ID="406"/>
33
    <LANGUAGESTRING ID="2" TEXT="Second text" LANGUAGE_ID="406"/>
34

  
35
</dataset>
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.java
100 100
    	// 	|- root : polytomous key node
101 101
    	// in a recursive call
102 102
        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
103
        pkey1 = cdmEntitySession.load(pkey1);
103

  
104 104

  
105 105
        // checking to make sure the root object is in the session cache
106 106
        Assert.assertSame(pkey1.getRoot(), cacher.getFromCache(pkey1.getRoot()));
......
118 118
    	//		|- statement : KeyStatement
119 119
    	// in a recursive call
120 120
        PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
121
        pkey = cdmEntitySession.load(pkey);
122 121
        CdmTransientEntityCacher cacher = getCacher(sessionOwner);
123 122
        // checking to make sure the root object is in the session cache
124 123
        Assert.assertSame(pkey.getRoot(), cacher.getFromCache(pkey.getRoot()));
......
140 139
    	//		|- question : KeyStatement
141 140
    	//		|- statement : KeyStatement
142 141
        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
143
        pkey1 = cdmEntitySession.load(pkey1);
142

  
144 143
        CdmTransientEntityCacher cacher = getCacher(sessionOwner);
145 144

  
146 145
    }
......
158 157
    	// 	|- root : polytomous key node
159 158
    	// in a recursive call
160 159
        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
161
        pkey1 = cdmEntitySession.load(pkey1);
160

  
162 161
        CdmTransientEntityCacher cacher = getCacher(sessionOwner);
163 162

  
164 163
    	// this call will load into the session cache the graph and update the objects in the sub-graph for a
......
167 166
    	//		|- question : KeyStatement
168 167
    	//		|- statement : KeyStatement
169 168
        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
170
        pkey2 = cdmEntitySession.load(pkey2);
169

  
171 170

  
172 171
        Assert.assertSame(pkey2.getRoot().getStatement(), cacher.getFromCache(pkey2.getRoot().getStatement()));
173 172
        Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
......
188 187
    	//		|- question : KeyStatement
189 188
    	//		|- statement : KeyStatement
190 189
        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
191
        pkey1 = cdmEntitySession.load(pkey1);
190

  
192 191
        CdmTransientEntityCacher cacher = getCacher(sessionOwner);
193 192

  
194 193
    	// this call will load into the session cache the graph and update the objects in the sub-graph for a
195 194
    	// polytomous key
196 195
    	// 	|- root : polytomous key node
197 196
        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
198
        pkey2 = cdmEntitySession.load(pkey2);
197

  
199 198

  
200 199
        Assert.assertSame(pkey2.getRoot().getStatement(), cacher.getFromCache(pkey2.getRoot().getStatement()));
201 200
        Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
......
215 214
    	//		|- question : KeyStatement
216 215
    	//		|- statement : KeyStatement
217 216
        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
218
        pkey1 = cdmEntitySession.load(pkey1);
217

  
219 218
        CdmTransientEntityCacher cacher = getCacher(sessionOwner);
220 219

  
221 220
        // checking that the root is not null and
......
229 228
    	// polytomous key
230 229
    	// 	|- root : polytomous key node
231 230
        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
232
        pkey2 = cdmEntitySession.load(pkey2);
231

  
233 232

  
234 233

  
235 234
        Assert.assertSame(pkey2.getRoot().getStatement(), cacher.getFromCache(pkey2.getRoot().getStatement()));
......
250 249
    	// 	|- root : polytomous key node
251 250

  
252 251
    	PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
253
        pkey1 = cdmEntitySession.load(pkey1);
252

  
254 253

  
255 254
        // lazy initialising root.statement
256 255
        KeyStatement st = CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class);
......
271 270
    	//		|- statement : KeyStatement
272 271

  
273 272
    	PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
274
    	pkey2 = cdmEntitySession.load(pkey2);
273

  
275 274

  
276 275
    	Assert.assertSame(pkey2.getRoot().getStatement(), cacher.getFromCache(pkey2.getRoot().getStatement(), KeyStatement.class));
277 276
    	Assert.assertSame(st, pkey2.getRoot().getStatement());
......
291 290

  
292 291
    	// this call will load into the session cache a polytomous key node object
293 292
    	PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1),PolytomousKeyNode.class);
294
    	rootPKNode = cdmEntitySession.load(rootPKNode);
293

  
295 294

  
296 295
    	Assert.assertNotNull(rootPKNode);
297 296
    	Assert.assertSame(rootPKNode, cacher.getFromCache(rootPKNode));
298 297

  
299 298
    	PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2),PolytomousKeyNode.class);
300
    	childOfRootPKNode = cdmEntitySession.load(childOfRootPKNode);
299

  
301 300

  
302 301
    	Assert.assertNotNull(childOfRootPKNode);
303 302
    	Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
......
309 308
    	//		|- statement : KeyStatement
310 309

  
311 310
    	PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
312
    	pkey = cdmEntitySession.load(pkey);
311

  
313 312

  
314 313
    	Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
315 314
    	Assert.assertSame(pkey.getRoot().getChildAt(1), childOfRootPKNode);
......
329 328
    	//		|- statement : KeyStatement
330 329

  
331 330
    	PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
332
    	pkey = cdmEntitySession.load(pkey);
331

  
333 332

  
334 333
    	// this call will load into the session cache a polytomous key node object
335 334
    	PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1),PolytomousKeyNode.class);
336
    	rootPKNode = cdmEntitySession.load(rootPKNode);
335

  
337 336

  
338 337
    	Assert.assertNotNull(rootPKNode);
339 338
    	Assert.assertSame(rootPKNode, cacher.getFromCache(rootPKNode));
340 339

  
341 340
    	PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2),PolytomousKeyNode.class);
342
    	childOfRootPKNode = cdmEntitySession.load(childOfRootPKNode);
341

  
343 342

  
344 343
    	Assert.assertNotNull(childOfRootPKNode);
345 344
    	Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
......
363 362
    	//		|- statement : KeyStatement
364 363

  
365 364
    	PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
366
    	pkey = cdmEntitySession.load(pkey);
365

  
367 366

  
368 367
    	PolytomousKeyNode childOfRootPKNode = pkey.getRoot().getChildAt(1);
369 368

  
......
400 399
    	//		|- statement : KeyStatement
401 400

  
402 401
    	PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY),PolytomousKey.class);
403
    	pkey = cdmEntitySession.load(pkey);
402

  
404 403

  
405 404
    	Map<Language, LanguageString> labelMap = pkey.getRoot().getStatement().getLabel();
406 405
    	Set<Language> languages = labelMap.keySet();
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/TaxonNameEditorTest.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.model;
11

  
12
import java.util.ArrayList;
13
import java.util.Iterator;
14
import java.util.List;
15
import java.util.Set;
16
import java.util.UUID;
17

  
18
import org.apache.log4j.Level;
19
import org.apache.log4j.Logger;
20
import org.eclipse.core.commands.ExecutionException;
21
import org.junit.Assert;
22
import org.junit.Before;
23
import org.junit.BeforeClass;
24
import org.junit.Test;
25
import org.unitils.dbunit.annotation.DataSet;
26

  
27
import eu.etaxonomy.cdm.api.service.IClassificationService;
28
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
29
import eu.etaxonomy.cdm.api.service.ITaxonService;
30
import eu.etaxonomy.cdm.model.common.Language;
31
import eu.etaxonomy.cdm.model.name.BotanicalName;
32
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
33
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
34
import eu.etaxonomy.cdm.model.name.NonViralName;
35
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
36
import eu.etaxonomy.cdm.model.taxon.Synonym;
37
import eu.etaxonomy.cdm.model.taxon.Taxon;
38
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
39
import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation;
40
import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
41
import eu.etaxonomy.taxeditor.operations.OperationTestBase;
42
import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
43
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
44
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
45
import eu.etaxonomy.taxeditor.session.MockSessionOwner;
46

  
47
/**
48
 * @author cmathew
49
 * @date 3 Feb 2015
50
 *
51
 */
52
@DataSet
53
public class TaxonNameEditorTest extends OperationTestBase {
54

  
55
    private static final Logger logger = Logger.getLogger(TaxonNameEditorTest.class);
56

  
57

  
58

  
59

  
60
    ITaxonNodeService taxonNodeService = getRemoteApplicationController().getTaxonNodeService();
61
    ITaxonService taxonService = getRemoteApplicationController().getTaxonService();
62
    IClassificationService classificationService = getRemoteApplicationController().getClassificationService();
63

  
64

  
65
    private CdmTransientEntityCacher cacher;
66
    private ICdmEntitySessionEnabled sessionOwner;
67

  
68
    private ICdmEntitySession cdmEntitySession;
69

  
70
    Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
71

  
72

  
73

  
74
    @BeforeClass
75
    public static void initializePolytomousKeyTest() {
76
        logger.setLevel(Level.INFO);
77
        CDMServer.getInstance().setKeepServerRunning(true);
78
        initializeController("default",
79
                "localhost",
80
                8080,
81
                "",
82
                NomenclaturalCode.ICNAFP,
83
                "admin",
84
                "00000");
85
    }
86

  
87
    @Before
88
    public void initializeSession() {
89
        sessionOwner = new MockSessionOwner();
90
        cdmEntitySession = cdmEntitySessionManager.newSession(sessionOwner, true);
91
        cacher = getCacher(sessionOwner);
92
    }
93

  
94
    @Test
95
    public void testAddHomotypicSynonym() throws ExecutionException {
96
        UUID taxonNodeUuid = UUID.fromString("ce54c396-3694-47f2-abb0-1d7b7e057985");
97

  
98
        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
99
        Taxon taxon = taxonNode.getTaxon();
100
        HomotypicalGroup group = taxon.getHomotypicGroup();
101
        BotanicalName newSynonymName = BotanicalName.NewInstance(null);
102
        newSynonymName.setTitleCache("New Synonym", true);
103
        operation = new CreateSynonymInExistingHomotypicalGroupOperation("Create Synonym In Existing Homotypical Group",
104
                undoContext, taxon, group, newSynonymName, postOperation);
105

  
106
        operation.execute(monitor, info);
107
        taxonNodeService.merge(taxonNode);
108
        Assert.assertEquals(taxon.getHomotypicGroup().getTypifiedNames().size(), 2);
109
        Assert.assertEquals(taxon.getSynonyms().size(), 1);
110
        Iterator<Synonym> synonymItr = taxon.getSynonyms().iterator();
111
        Synonym synonym = synonymItr.next();
112
        Assert.assertTrue(taxon.getHomotypicGroup().getTypifiedNames().contains(synonym.getName()));
113
    }
114

  
115
    @Test
116
    public void addHeterotypicSynonym() throws ExecutionException {
117
        UUID taxonNodeUuid = UUID.fromString("ce54c396-3694-47f2-abb0-1d7b7e057985");
118

  
119
        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
120
        Taxon taxon = taxonNode.getTaxon();
121
        HomotypicalGroup group = taxon.getHomotypicGroup();
122
        BotanicalName newSynonymName = BotanicalName.NewInstance(null);
123
        newSynonymName.setTitleCache("New Synonym", true);
124
        operation = new CreateSynonymInExistingHomotypicalGroupOperation("Create Synonym In Existing Homotypical Group",
125
                undoContext, taxon, group, newSynonymName, postOperation);
126

  
127
        operation.execute(monitor, info);
128
        taxonNodeService.merge(taxonNode);
129

  
130

  
131
    }
132

  
133
    @Test
134
    public void addDeleteAddHomotypicSynonym() throws ExecutionException {
135
        UUID taxonNodeUuid = UUID.fromString("ce54c396-3694-47f2-abb0-1d7b7e057985");
136

  
137
        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
138
        Taxon taxon = taxonNode.getTaxon();
139
        HomotypicalGroup group = taxon.getHomotypicGroup();
140
        BotanicalName newSynonymName = BotanicalName.NewInstance(null);
141
        newSynonymName.setTitleCache("New Synonym", true);
142
        operation = new CreateSynonymInExistingHomotypicalGroupOperation("Create Synonym In Existing Homotypical Group",
143
                undoContext, taxon, group, newSynonymName, postOperation);
144

  
145
        operation.execute(monitor, info);
146
        taxonNodeService.merge(taxonNode);
147
        Assert.assertEquals(taxon.getHomotypicGroup().getTypifiedNames().size(), 2);
148

  
149
        Set<Synonym> synonyms = taxon.getSynonyms();
150
        for(Synonym synonym : synonyms) {
151
            taxonService.deleteSynonym(synonym.getUuid(), taxon.getUuid(), null);
152
        }
153

  
154
        taxonNodeService.merge(taxonNode);
155

  
156
        newSynonymName = BotanicalName.NewInstance(null);
157
        newSynonymName.setTitleCache("Another New Synonym", true);
158
        operation = new CreateSynonymInExistingHomotypicalGroupOperation("Create Synonym In Existing Homotypical Group",
159
                undoContext, taxon, group, newSynonymName, postOperation);
160

  
161
        operation.execute(monitor, info);
162
        taxonNodeService.merge(taxonNode);
163
    }
164

  
165
    @Test
166
    public void swapSynonymWithAcceptedTaxon() throws ExecutionException {
167
        List<TaxonNode> rootEntities = new ArrayList<TaxonNode>();
168
        UUID taxonNodeUuid = UUID.fromString("d425a971-1abe-4895-9e1f-1e5c8ff1c84c");
169
        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
170
        rootEntities.add(taxonNode);
171
        sessionOwner = new MockSessionOwner(rootEntities);
172
        cdmEntitySession = cdmEntitySessionManager.newSession(sessionOwner, true);
173

  
174
        UUID taxonUuid = UUID.fromString("9763e5f0-6cd4-4d96-b8a4-4420854f7727");
175
        Taxon taxon = (Taxon)taxonService.load(taxonUuid);
176
        TaxonNameBase taxonName = taxon.getName();
177

  
178
        UUID synonymUuid = UUID.fromString("1eb173bd-b174-4162-8ff5-5136d8f1e746");
179
        Synonym synonym = (Synonym)taxonService.load(synonymUuid);
180
        TaxonNameBase synonymName = synonym.getName();
181

  
182
        taxonService.swapSynonymAndAcceptedTaxon(synonym.getUuid(), taxon.getUuid());
183

  
184
        Assert.assertEquals(taxonName, synonym.getName());
185
        Assert.assertEquals(synonymName, taxon.getName());
186
    }
187

  
188
    @Test
189
    public void addTaxon() {
190
        NonViralName taxonName = NonViralName.NewInstance(null);
191
        Taxon taxon = Taxon.NewInstance(taxonName, null);
192
        taxonService.merge(taxon);
193
    }
194
}
195

  
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/TaxonNavigatorTest.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.model;
11

  
12
import org.apache.log4j.Level;
13
import org.apache.log4j.Logger;
14
import org.junit.Before;
15
import org.junit.BeforeClass;
16
import org.junit.Test;
17

  
18
import eu.etaxonomy.cdm.api.service.IClassificationService;
19
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
20
import eu.etaxonomy.cdm.api.service.ITaxonService;
21
import eu.etaxonomy.cdm.model.common.Language;
22
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
23
import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
24
import eu.etaxonomy.taxeditor.operations.OperationTestBase;
25
import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
26
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
27
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
28
import eu.etaxonomy.taxeditor.session.MockSessionOwner;
29

  
30
/**
31
 * @author cmathew
32
 * @date 9 Mar 2015
33
 *
34
 */
35
public class TaxonNavigatorTest extends OperationTestBase {
36

  
37
    private static final Logger logger = Logger.getLogger(TaxonNameEditorTest.class);
38

  
39

  
40

  
41

  
42
    ITaxonNodeService taxonNodeService = getRemoteApplicationController().getTaxonNodeService();
43
    ITaxonService taxonService = getRemoteApplicationController().getTaxonService();
44
    IClassificationService classificationService = getRemoteApplicationController().getClassificationService();
45

  
46

  
47
    private CdmTransientEntityCacher cacher;
48
    private ICdmEntitySessionEnabled sessionOwner;
49
    private ICdmEntitySession cdmEntitySession;
50

  
51
    Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
52

  
53

  
54

  
55
    @BeforeClass
56
    public static void initializePolytomousKeyTest() {
57
        logger.setLevel(Level.INFO);
58
        CDMServer.getInstance().setKeepServerRunning(true);
59
        initializeController("default",
60
                "localhost",
61
                8080,
62
                "",
63
                NomenclaturalCode.ICNAFP,
64
                "admin",
65
                "00000");
66
    }
67

  
68

  
69
    @Before
70
    public void initializeSession() {
71
        sessionOwner = new MockSessionOwner();
72
        cdmEntitySession = cdmEntitySessionManager.newSession(sessionOwner, true);
73
        cacher = getCacher(sessionOwner);
74
    }
75

  
76
    @Test
77
    public void addNewTaxonTest() {
78

  
79
    }
80

  
81
    @Test
82
    public void addNewClassificationTest() {
83

  
84
    }
85

  
86
    @Test
87
    public void changeAcceptedTaxonToSynonymTest() {
88

  
89
    }
90

  
91
    @Test
92
    public void moveTaxonTest() {
93

  
94
    }
95

  
96

  
97
}
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/TaxonNodeTest.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.model;
11

  
12
import java.util.UUID;
13

  
14
import org.apache.log4j.Level;
15
import org.apache.log4j.Logger;
16
import org.junit.Before;
17
import org.junit.BeforeClass;
18
import org.junit.Test;
19
import org.unitils.dbunit.annotation.DataSet;
20

  
21
import eu.etaxonomy.cdm.api.service.DeleteResult;
22
import eu.etaxonomy.cdm.api.service.IClassificationService;
23
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
24
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
25
import eu.etaxonomy.cdm.model.common.Language;
26
import eu.etaxonomy.cdm.model.name.BotanicalName;
27
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
28
import eu.etaxonomy.cdm.model.name.Rank;
29
import eu.etaxonomy.cdm.model.taxon.Classification;
30
import eu.etaxonomy.cdm.model.taxon.Taxon;
31
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
32
import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
33
import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
34
import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
35
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
36
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
37
import eu.etaxonomy.taxeditor.session.MockSessionOwner;
38

  
39
/**
40
 * @author cmathew
41
 * @date 3 Feb 2015
42
 *
43
 */
44
@DataSet
45
public class TaxonNodeTest extends BaseRemotingTest {
46

  
47
    private static final Logger logger = Logger.getLogger(TaxonNodeTest.class);
48

  
49
    UUID taxonNodeUuid = UUID.fromString("324a1a77-689c-44be-8e65-347d835f4111");
50
    private static final UUID classificationUuid = UUID.fromString("6c2bc8d9-ee62-4222-be89-4a8e31770878");
51

  
52
    private static final UUID node1Uuid= UUID.fromString("484a1a77-689c-44be-8e65-347d835f47e8");
53
    private static final UUID node2Uuid = UUID.fromString("2d41f0c2-b785-4f73-a436-cc2d5e93cc5b");
54

  
55
    private static final UUID rootNodeUuid = UUID.fromString("324a1a77-689c-44be-8e65-347d835f4111");
56

  
57
    ITaxonNodeService taxonNodeService = getRemoteApplicationController().getTaxonNodeService();
58
    IClassificationService classificationService = getRemoteApplicationController().getClassificationService();
59

  
60

  
61
    private CdmTransientEntityCacher cacher;
62
    private ICdmEntitySessionEnabled sessionOwner;
63

  
64
    private ICdmEntitySession cdmEntitySession;
65

  
66
    Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
67

  
68

  
69

  
70
    @BeforeClass
71
    public static void initializePolytomousKeyTest() {
72
        logger.setLevel(Level.INFO);
73
        CDMServer.getInstance().setKeepServerRunning(true);
74
        initializeController("default",
75
                "localhost",
76
                8080,
77
                "",
78
                NomenclaturalCode.ICNAFP,
79
                "admin",
80
                "00000");
81
    }
82

  
83
    @Before
84
    public void initializeSession() {
85
        sessionOwner = new MockSessionOwner();
86
        cdmEntitySession = cdmEntitySessionManager.newSession(sessionOwner, true);
87
        cacher = getCacher(sessionOwner);
88
    }
89

  
90
    @Test
91
    public void deleteTaxonNode() {
92
        Classification classification = classificationService.load(classificationUuid);
93
        TaxonNode node1 = taxonNodeService.load(node1Uuid);
94
        TaxonNode node2 = taxonNodeService.load(rootNodeUuid);
95
        node1 = (TaxonNode)HibernateProxyHelper.deproxy(node1);
96

  
97
        TaxonNode newNode = node1.addChildTaxon(Taxon.NewInstance(BotanicalName.NewInstance(Rank.SPECIES()), null), null, null);
98
        newNode = taxonNodeService.merge(newNode);
99
        newNode = taxonNodeService.load(newNode.getUuid());
100
        UUID taxUUID = newNode.getTaxon().getUuid();
101
        UUID nameUUID = newNode.getTaxon().getName().getUuid();
102

  
103
        DeleteResult result = taxonNodeService.deleteTaxonNode(node1, null);
104

  
105
        node1 = taxonNodeService.load(node1Uuid);
106
    }
107
}
108

  
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operations/OperationTestBase.java
1
// $Id$
2
/**
3
* Copyright (C) 2007 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

  
11
package eu.etaxonomy.taxeditor.operations;
12

  
13
import org.eclipse.core.commands.operations.IUndoContext;
14
import org.eclipse.core.runtime.IAdaptable;
15
import org.eclipse.core.runtime.IProgressMonitor;
16
import org.eclipse.core.runtime.NullProgressMonitor;
17

  
18
import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
19
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
20
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
21
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
22

  
23
/**
24
 * @author n.hoffmann
25
 * @created 15.04.2009
26
 * @version 1.0
27
 */
28
public class OperationTestBase extends BaseRemotingTest {
29

  
30
	public static final IUndoContext undoContext = null;
31

  
32
	public static final IProgressMonitor monitor = new NullProgressMonitor();
33
	public static final IAdaptable info = null;
34
	public static final IPostOperationEnabled postOperation = null;
35
	public static final ICdmEntitySessionEnabled cdmEntitySessionEnabled = null;
36

  
37
	protected static AbstractPostOperation operation;
38

  
39
}
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManagerTest.java
46 46

  
47 47
		PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
48 48
		cdmEntitySessionManager.bind(null);
49
		PolytomousKey pKeyLoaded = cdmEntitySessionManager.load(pKey);
50
		Assert.assertSame(pKeyLoaded, pKey);
49
		Assert.assertSame(pKey, pKey);
51 50
		Assert.assertNull(getActiveSession());
52 51
	}
53 52

  
54 53
	@Test
55 54
	public void manageSessionWithObjectTest() {
56 55
		PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
57
		pKey = cdmEntitySession.load(pKey);
56

  
58 57
		Assert.assertNotNull(getActiveSession());
59 58
		List<CdmBase> rootEntities = (List<CdmBase>)getFieldValueViaReflection(getActiveSession(), "rootEntities");
60 59

  
......
70 69

  
71 70
		sessionOwner = new MockSessionOwner();
72 71
		pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
73
		pKey = cdmEntitySession.load(pKey);
72

  
74 73

  
75 74
		Assert.assertEquals(pKey.getTitleCache(), upTitleCache);
76 75
		Assert.assertEquals(pKey.getRoot().getChildAt(0).getStatement().getLabel(english).getText(), upStatement);
......
79 78
	@Test
80 79
	public void manageSessionWithListTest() {
81 80
		List<PolytomousKey> pKeys = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
82
		pKeys = (List<PolytomousKey>) cdmEntitySession.load(pKeys);
83 81
		Assert.assertNotNull(getActiveSession());
84 82
		List<CdmBase> rootEntities = (List<CdmBase>)getFieldValueViaReflection(getActiveSession(), "rootEntities");
85 83

  
......
99 97

  
100 98
		sessionOwner = new MockSessionOwner();
101 99
		pKeys = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
102
		pKeys = (List<PolytomousKey>) cdmEntitySession.load(pKeys);
100

  
103 101
		Assert.assertEquals(pKeys.get(0).getTitleCache(), upTitleCache);
104 102
		Assert.assertEquals(pKeys.get(1).getRoot().getChildAt(0).getStatement().getLabel(english).getText(), upStatement);
105 103

  
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/MockSessionOwner.java
6 6
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
7 7
import eu.etaxonomy.taxeditor.session.mock.MockCdmEntitySession;
8 8

  
9
public class MockSessionOwner implements ICdmEntitySessionEnabled {
9
public class MockSessionOwner<T extends CdmBase> implements ICdmEntitySessionEnabled {
10 10

  
11
    List<T> rootEntities;
12

  
13

  
14
    public MockSessionOwner() {
15
        rootEntities = null;
16
    }
17

  
18
    public MockSessionOwner(List<T> rootEntities) {
19
        this.rootEntities = rootEntities;
20
    }
11 21
    /* (non-Javadoc)
12 22
     * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
13 23
     */
......
28 38
     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
29 39
     */
30 40
    @Override
31
    public <T extends CdmBase> List<T> getRootEntities() {
32
        return null;
41
    public  List<T> getRootEntities() {
42
        return rootEntities;
33 43
    }
34 44

  
35 45
}

Also available in: Unified diff