3 * Copyright (C) 2014 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.ext
.occurrence
.gbif
;
12 import junit
.framework
.TestCase
;
13 import net
.sf
.json
.JSONObject
;
14 import net
.sf
.json
.JSONSerializer
;
15 import net
.sf
.json
.JsonConfig
;
17 import org
.junit
.Test
;
24 public class GbifQueryServiceWrapperTest
extends TestCase
{
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": [ ],
37 // "basisOfRecord": "OBSERVATION",
38 // "decimalLongitude": -1.0193,
39 // "decimalLatitude": 52.51021,
40 // "continent": "EUROPE",
44 // "eventDate": "2006-06-29T22:00:00.000+0000",
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"
60 public void testJsonToCdmObject(){
61 JSONObject jsonObject
= JSONObject
.fromObject(dummyJson
);
62 Object java
= JSONSerializer
.toJava(jsonObject
);
63 JsonConfig config
= new JsonConfig();