1 package eu
.etaxonomy
.cdm
.print
.out
.mediawiki
;
3 import java
.net
.MalformedURLException
;
5 import org
.junit
.Before
;
6 import org
.junit
.Ignore
;
9 public class Cdm2MediawikiExporterTest
{
11 // ############## parameter###############
13 // *****************portals and their nodes ********************
16 String webServiceUrl
= "http://dev.e-taxonomy.eu/cdmserver/palmae/";
17 String taxonName
= "Aphandra";// Acrocomia";//"Actinorhytis";
18 String wikiPrefix
= null;
19 String classificationName
= null;
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;
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;
36 // ******************other parameters **********************
38 // ..................mediawiki...........................
40 String wikiUrl
= "http://biowikifarm.net/testwiki";
41 String loginName
= "Sybille Bürs";
42 // String password = CdmUtils.readInputLine("Password: ");
43 String password
= "ssetakil3?";
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;
51 // #############################################
53 Cdm2MediawikiExporter exporter
;
56 public void setUp() throws Exception
{
57 exporter
= new Cdm2MediawikiExporter();
62 public void testExport() throws MalformedURLException
{
64 exporter
.export(webServiceUrl
, taxonName
, classificationName
, wikiUrl
,
65 loginName
, password
, wikiPrefix
, true, false, true);
70 // public void testExportEntireDatabase() throws MalformedURLException {
71 // // do complete export
72 // exporter.export(webServiceUrl, wikiUrl, loginName, password,
73 // wikiPrefix, true, false, true);
78 public void testExportFromXmlFile() throws MalformedURLException
{
80 cdmExported
= "/home/sybille/.cdmLibrary/mediawiki_tmp/20131022-1440-cdm_output.xml";
82 exporter
.exportFromXmlFile(cdmExported
, webServiceUrl
, wikiUrl
,
83 loginName
, password
, wikiPrefix
, false, false, false);
87 public void testUploadToMediawiki() {
88 // do only wiki import
90 wikiFile
= "/home/sybille/.cdmLibrary/mediawiki_tmp/20131022-1533-output.xml";
91 exporter
.uploadToMediawiki(wikiFile
, wikiUrl
, loginName
, password
);