commit after merge from trunc
[cdmlib.git] / cdmlib-print / src / test / java / eu / etaxonomy / cdm / print / out / mediawiki / Cdm2MediawikiExporterTest.java
1 package eu.etaxonomy.cdm.print.out.mediawiki;
2
3 import java.net.MalformedURLException;
4
5 import org.junit.Before;
6 import org.junit.Ignore;
7 import org.junit.Test;
8
9 public class Cdm2MediawikiExporterTest {
10
11 // ############## parameter###############
12
13 // *****************portals and their nodes ********************
14
15 // palmweb
16 String webServiceUrl = "http://dev.e-taxonomy.eu/cdmserver/palmae/";
17 String taxonName = "Aphandra";// Acrocomia";//"Actinorhytis";
18 String wikiPrefix = null;
19 String classificationName = null;
20
21 // flora of c a
22 // String webServiceUrl =
23 // "http://dev.e-taxonomy.eu/cdmserver/flora_central_africa/";
24 // String taxonName="Agarista";
25 // // // String taxonName="Restionaceae";
26 // String wikiPrefix="Internal";
27 // String classificationName=null;
28
29 // //cichoriae
30 // private static final String webServiceUrl =
31 // "http://dev.e-taxonomy.eu/cdmserver/cichorieae/";
32 // String taxonName = "Askellia alaica";
33 // String classificationName ="standard view";
34 // String wikiPrefix = null;
35
36 // ******************other parameters **********************
37
38 // ..................mediawiki...........................
39
40 String wikiUrl = "http://biowikifarm.net/testwiki";
41 String loginName = "Sybille Bürs";
42 // String password = CdmUtils.readInputLine("Password: ");
43 String password = "ssetakil3?";
44
45 // inputfiles:
46 // TODO put a cdm exported file in here:
47 private String cdmExported = null;
48 // TODO put a mediawiki xml file in here:
49 String wikiFile = null;
50
51 // #############################################
52
53 Cdm2MediawikiExporter exporter;
54
55 @Before
56 public void setUp() throws Exception {
57 exporter = new Cdm2MediawikiExporter();
58
59 }
60
61 @Test
62 public void testExport() throws MalformedURLException {
63 // do complete export
64 exporter.export(webServiceUrl, taxonName, classificationName, wikiUrl,
65 loginName, password, wikiPrefix, true, false, true);
66
67 }
68
69 // @Test
70 // public void testExportEntireDatabase() throws MalformedURLException {
71 // // do complete export
72 // exporter.export(webServiceUrl, wikiUrl, loginName, password,
73 // wikiPrefix, true, false, true);
74 //
75 // }
76
77 @Test
78 public void testExportFromXmlFile() throws MalformedURLException {
79 // TODO
80 cdmExported = "/home/sybille/.cdmLibrary/mediawiki_tmp/20131022-1440-cdm_output.xml";
81
82 exporter.exportFromXmlFile(cdmExported, webServiceUrl, wikiUrl,
83 loginName, password, wikiPrefix, false, false, false);
84 }
85
86 @Test
87 public void testUploadToMediawiki() {
88 // do only wiki import
89 // TODO
90 wikiFile = "/home/sybille/.cdmLibrary/mediawiki_tmp/20131022-1533-output.xml";
91 exporter.uploadToMediawiki(wikiFile, wikiUrl, loginName, password);
92
93 }
94
95 }