// Path: api/catalog-reader/src/main/java/esride/opendatabridge/reader/MetadataObjectResult.java
// public class MetadataObjectResult {
// 
//     private List<MetadataObject> metadataObjectList;
// 
//     private int actualStartPosition;
//     private int nextStartPosition;
// 
//     private boolean hasNextStartPosition;
// 
//     public List<MetadataObject> getMetadataObjectList() {
//         return metadataObjectList;
//     }
// 
//     public void setMetadataObjectList(List<MetadataObject> pMetadataObjectList) {
//         metadataObjectList = pMetadataObjectList;
//     }
// 
//     public int getActualStartPosition() {
//         return actualStartPosition;
//     }
// 
//     public void setActualStartPosition(int pActualStartPosition) {
//         actualStartPosition = pActualStartPosition;
//     }
// 
//     public int getNextStartPosition() {
//         return nextStartPosition;
//     }
// 
//     public void setNextStartPosition(int pNextStartPosition) {
//         nextStartPosition = pNextStartPosition;
//     }
// 
//     public boolean isHasNextStartPosition() {
//         return hasNextStartPosition;
//     }
// 
//     public void setHasNextStartPosition(boolean pHasNextStartPosition) {
//         hasNextStartPosition = pHasNextStartPosition;
//     }
// }


import esride.opendatabridge.reader.MetadataObjectResult;
import esride.opendatabridge.reader.ReaderException;
import esride.opendatabridge.reader.TransformedItem;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import java.util.HashMap;
import java.util.List;
    public void testGetBremenItemsFromCatalog(){
        HashMap<String, String> processProperties = new HashMap<String, String>();
        processProperties.put("ckan.url", "http://www.govdata.de/ckan/api/search/dataset");
        processProperties.put("ckan_request_search_param_q", "daten.bremen.de");
        //res_format=CSV&res_format=csv&res_format=wms
        processProperties.put("ckan_request_search_param_res_format", "CSV");
        processProperties.put("ckan_request_search_param_all_fields", "1");
        processProperties.put("ckan_request_search_param_offset", "0");
        processProperties.put("ckan_request_search_param_limit", "20");

        try {
            ckanReader.setProperties(processProperties, "TestBremen");
        } catch (ReaderException e) {
            Assert.fail(e.getMessage());
        }

        try {
            MetadataObjectResult items = ckanReader.getItemsFromCatalog(1);
        } catch (ReaderException e) {
            Assert.fail(e.getMessage());
        }
    }


    @Test
    public void testGetSpecialItemsFromCatalog(){
        HashMap<String, String> processProperties = new HashMap<String, String>();
        processProperties.put("ckan.url", "http://www.govdata.de/ckan/api/search/dataset");
        //processProperties.put("ckan_request_search_param_q", "geo.sv.rostock.de");
        processProperties.put("ckan_request_search_param_q", "de-hh-inspire-gemarkungsgrenze");
// Path: api/catalog-reader/src/main/java/esride/opendatabridge/reader/MetadataObjectResult.java
// public class MetadataObjectResult {
// 
//     private List<MetadataObject> metadataObjectList;
// 
//     private int actualStartPosition;
//     private int nextStartPosition;
// 
//     private boolean hasNextStartPosition;
// 
//     public List<MetadataObject> getMetadataObjectList() {
//         return metadataObjectList;
//     }
// 
//     public void setMetadataObjectList(List<MetadataObject> pMetadataObjectList) {
//         metadataObjectList = pMetadataObjectList;
//     }
// 
//     public int getActualStartPosition() {
//         return actualStartPosition;
//     }
// 
//     public void setActualStartPosition(int pActualStartPosition) {
//         actualStartPosition = pActualStartPosition;
//     }
// 
//     public int getNextStartPosition() {
//         return nextStartPosition;
//     }
// 
//     public void setNextStartPosition(int pNextStartPosition) {
//         nextStartPosition = pNextStartPosition;
//     }
// 
//     public boolean isHasNextStartPosition() {
//         return hasNextStartPosition;
//     }
// 
//     public void setHasNextStartPosition(boolean pHasNextStartPosition) {
//         hasNextStartPosition = pHasNextStartPosition;
//     }
// }


// Path: api/ckan-reader/src/test/java/esride/opendatabridge/reader/ckan/IntegrationTestCkanReader.java
import esride.opendatabridge.reader.MetadataObjectResult;
import esride.opendatabridge.reader.ReaderException;
import esride.opendatabridge.reader.TransformedItem;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import java.util.HashMap;
import java.util.List;

    public void testGetBremenItemsFromCatalog(){
        HashMap<String, String> processProperties = new HashMap<String, String>();
        processProperties.put("ckan.url", "http://www.govdata.de/ckan/api/search/dataset");
        processProperties.put("ckan_request_search_param_q", "daten.bremen.de");
        //res_format=CSV&res_format=csv&res_format=wms
        processProperties.put("ckan_request_search_param_res_format", "CSV");
        processProperties.put("ckan_request_search_param_all_fields", "1");
        processProperties.put("ckan_request_search_param_offset", "0");
        processProperties.put("ckan_request_search_param_limit", "20");

        try {
            ckanReader.setProperties(processProperties, "TestBremen");
        } catch (ReaderException e) {
            Assert.fail(e.getMessage());
        }

        try {
            MetadataObjectResult items = ckanReader.getItemsFromCatalog(1);
        } catch (ReaderException e) {
            Assert.fail(e.getMessage());
        }
    }


    @Test
    public void testGetSpecialItemsFromCatalog(){
        HashMap<String, String> processProperties = new HashMap<String, String>();
        processProperties.put("ckan.url", "http://www.govdata.de/ckan/api/search/dataset");
        //processProperties.put("ckan_request_search_param_q", "geo.sv.rostock.de");
        processProperties.put("ckan_request_search_param_q", "de-hh-inspire-gemarkungsgrenze");
        processProperties.put("ckan_request_search_param_all_fields", "1");