package org.mousephenotype.cda.solr.service;

import java.util.List;

import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.junit.Test;
import org.mousephenotype.cda.solr.service.dto.ObservationDTO;


//@ContextConfiguration( locations={ "classpath:test-Observations.xml" })
public class HistopathServiceTest {
	

	
	
	@Test
	public void getTableDataTest(){
		//gene_accession_id:"MGI:2449119"
		//HistoPath_1481
		//looks like we don't pick up the associated pato term in the indexer e.g.
		//<ontologyParameter parameterID="IMPC_HIS_119_001" sequenceID="1">
        //<term>PATO:0001566:diffuse</term>
		//</ontologyParameter>
		
		HttpSolrServer solr=new HttpSolrServer("http://ves-ebi-d0.ebi.ac.uk:8090/mi/impc/dev/solr/experiment/");
		ObservationService observationService= new ObservationService(solr);
		HistopathService histopathService=new HistopathService(observationService);
		String geneAccession="MGI:2449119";
		try {
			histopathService.getTableData(geneAccession);
			
			
		} catch (SolrServerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	

}
@@ -61,16 +61,38 @@
 il.List;
+%0Aimport java.util.Map;
 %0A%0Aimport
@@ -285,16 +285,82 @@
 ionDTO;%0A
+import org.mousephenotype.cda.solr.web.dto.HistopathPageTableRow;%0A
 %0A%0A//@Con
@@ -1040,16 +1040,22 @@
 rvice);%0A
+%09%09%0A%09%09%0A
 %09%09String
@@ -1099,51 +1099,342 @@
 %0A%09%09%09
-histopathService.getTableData(geneAccession
+List%3CObservationDTO%3E allObservations = histopathService.getObservationsForHistopathForGene(geneAccession);%0A%09%09%09Map%3CString, List%3CObservationDTO%3E%3E extSampleIdToObservations = histopathService.screenOutObservationsThatAreNormal(allObservations);%0A%09%09%09List%3CHistopathPageTableRow%3E histopathRows = histopathService.getTableData(allObservations
 );%0A%09

fix for histopath test