package uk.ac.ebi.atlas.search.analyticsindex;

import com.google.common.collect.ImmutableSet;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import uk.ac.ebi.atlas.web.GeneQuery;

import javax.inject.Inject;

import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = {"classpath:applicationContext.xml", "classpath:solrContextIT.xml", "classpath:oracleContext.xml"})
public class AnalyticsSearchDAOIT {

    @Inject
    private AnalyticsIndexSearchDAO subject;

    @Test
    public void all() {
        ImmutableSet<String> experimentTypes = subject.fetchExperimentTypes(GeneQuery.create("*"));
        assertThat(experimentTypes, containsInAnyOrder("microarray_1colour_microrna_differential", "microarray_1colour_mrna_differential", "microarray_2colour_mrna_differential", "rnaseq_mrna_baseline", "rnaseq_mrna_differential", "proteomics_baseline"));
    }

    @Test
    public void baselineResultOnly() {
        ImmutableSet<String> experimentTypes = subject.fetchExperimentTypes(GeneQuery.create("ENSG00000005810"));
        assertThat(experimentTypes, containsInAnyOrder("proteomics_baseline", "rnaseq_mrna_baseline"));
    }


    @Test
    public void diffResultOnly() {
        ImmutableSet<String> experimentTypes = subject.fetchExperimentTypes(GeneQuery.create("FBgn0000064"));
        assertThat(experimentTypes, contains("rnaseq_mrna_differential"));
    }

}
@@ -92,33 +92,8 @@
 et;%0A
-import org.junit.Ignore;%0A
 impo
@@ -111,16 +111,16 @@
 t.Test;%0A
+
 import o
@@ -471,53 +471,8 @@
 er;%0A
-import static org.hamcrest.Matchers.hasSize;%0A
 impo
@@ -547,47 +547,8 @@
 ns;%0A
-import static org.hamcrest.core.Is.is;%0A
 impo
@@ -1008,11 +1008,8 @@
 ate(
-%22*%22
 ));%0A
@@ -1542,16 +1542,15 @@
 ));%0A
+
     %7D%0A%0A
-%0A
     

Fix tests in http://bar:8085/browse/ATLAS-TESTDELIVERY-3545