Repository: gora Updated Branches: refs/heads/master 9e95efe2c -> 3879e1a68
Remove unwanted SolrTestStore Project: http://git-wip-us.apache.org/repos/asf/gora/repo Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/3879e1a6 Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/3879e1a6 Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/3879e1a6 Branch: refs/heads/master Commit: 3879e1a68fa1d8fd500a2db1c5be2de8b2a3d4d4 Parents: 9e95efe Author: madhawa-gunasekara <madha...@wso2.com> Authored: Wed Jun 7 20:51:10 2017 +0530 Committer: madhawa-gunasekara <madha...@wso2.com> Committed: Wed Jun 7 20:51:10 2017 +0530 ---------------------------------------------------------------------- .../apache/gora/solr/store/TestSolrStore.java | 104 ------------------- 1 file changed, 104 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/gora/blob/3879e1a6/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrStore.java ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrStore.java b/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrStore.java deleted file mode 100644 index 9c8f088..0000000 --- a/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrStore.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.gora.solr.store; - -import org.apache.gora.examples.WebPageDataCreator; -import org.apache.gora.examples.generated.Employee; -import org.apache.gora.examples.generated.WebPage; -import org.apache.gora.query.Query; -import org.apache.gora.solr.GoraSolrTestDriver; -import org.apache.gora.store.DataStore; -import org.apache.gora.store.DataStoreFactory; -import org.apache.gora.store.DataStoreTestBase; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -import static junit.framework.Assert.assertNull; -import static org.apache.gora.examples.WebPageDataCreator.SORTED_URLS; -import static org.apache.gora.examples.WebPageDataCreator.URLS; -import static org.apache.gora.store.DataStoreTestUtil.assertNumResults; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -public class TestSolrStore extends DataStoreTestBase { - - private static final Logger LOG = LoggerFactory.getLogger(TestSolrStore.class); - private static final int NUM_KEYS = 4; - - static { - setTestDriver(new GoraSolrTestDriver()); - } - - @Override - public void testDeleteByQueryFields() - throws Exception { - Query<String, WebPage> query; - - //test 5 - delete all with some fields - WebPageDataCreator.createWebPageData(this.webPageStore); - - query = this.webPageStore.newQuery(); - query.setFields("outlinks" - , "parsedContent", "content"); - - assertNumResults(this.webPageStore.newQuery(), URLS.length); - this.webPageStore.deleteByQuery(query); - - this.webPageStore.flush(); - - assertNumResults(this.webPageStore.newQuery(), URLS.length); - - //assert that data is deleted - for (String SORTED_URL : SORTED_URLS) { - WebPage page = this.webPageStore.get(SORTED_URL); - assertNotNull(page); - - assertNotNull(page.getUrl()); - assertEquals(page.getUrl().toString(), SORTED_URL); - assertEquals("Map of Outlinks should have a size of '0' as the deleteByQuery " - + "not only removes the data but also the data structure.", 0, page.getOutlinks().size()); - assertEquals(0, page.getParsedContent().size()); - if (page.getContent() != null) { - LOG.info("url: {}", page.getUrl().toString()); - LOG.info("limit: {}", page.getContent().limit()); - } else { - assertNull(page.getContent()); - } - } - - //test 6 - delete some with some fields - WebPageDataCreator.createWebPageData(this.webPageStore); - - query = this.webPageStore.newQuery(); - query.setFields("url"); - String startKey = SORTED_URLS[NUM_KEYS]; - String endKey = SORTED_URLS[SORTED_URLS.length - NUM_KEYS]; - query.setStartKey(startKey); - query.setEndKey(endKey); - - assertNumResults(this.webPageStore.newQuery(), URLS.length); - this.webPageStore.deleteByQuery(query); - - this.webPageStore.flush(); - - assertNumResults(query,0); - - } -}