- added gbif external service for querying GBIF
[cdmlib.git] / cdmlib-ext / src / test / java / eu / etaxonomy / cdm / ext / occurrence / gbif / GbifQueryServiceWrapperTest.java
1 // $Id$
2 /**
3 * Copyright (C) 2014 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.ext.occurrence.gbif;
11
12 import junit.framework.TestCase;
13 import net.sf.json.JSONObject;
14 import net.sf.json.JSONSerializer;
15 import net.sf.json.JsonConfig;
16
17 import org.junit.Test;
18
19 /**
20 * @author pplitzner
21 * @date 20.05.2014
22 *
23 */
24 public class GbifQueryServiceWrapperTest extends TestCase{
25
26 private final String dummyJson = "{" +
27 "\"key\": 252408386," +
28 "\"datasetKey\": \"26a49731-9457-45b2-9105-1b96063deb26\"," +
29 "\"publishingOrgKey\": \"07f617d0-c688-11d8-bf62-b8a03c50a862\"," +
30 "\"publishingCountry\": \"GB\"," +
31 "\"protocol\": \"DWC_ARCHIVE\"," +
32 "\"lastCrawled\": \"2013-09-07T07:08:17.000+0000\"}";
33 // "identifiers": [ ],
34 // "media": [ ],
35 // "facts": [ ],
36 // "relations": [ ],
37 // "basisOfRecord": "OBSERVATION",
38 // "decimalLongitude": -1.0193,
39 // "decimalLatitude": 52.51021,
40 // "continent": "EUROPE",
41 // "year": 2006,
42 // "month": 6,
43 // "day": 30,
44 // "eventDate": "2006-06-29T22:00:00.000+0000",
45 // "issues": [ ],
46 // "lastInterpreted": "2014-04-01T23:31:15.462+0000",
47 // "geodeticDatum": "WGS84",
48 // "countryCode": "GB",
49 // "country": "United Kingdom",
50 // "gbifID": "252408386",
51 // "institutionCode": "Leicestershire and Rutland Environmental Records Centre",
52 // "catalogNumber": "70875196",
53 // "recordedBy": "DA Lott",
54 // "locality": "Saddington Reservoir, Saddington Reservoir",
55 // "collectionCode": "7472",
56 // "identifiedBy": "DA Lott"
57 //}"
58
59 @Test
60 public void testJsonToCdmObject(){
61 JSONObject jsonObject = JSONObject.fromObject(dummyJson);
62 Object java = JSONSerializer.toJava(jsonObject);
63 JsonConfig config = new JsonConfig();
64 }
65
66 }