Return-Path: X-Original-To: apmail-manifoldcf-commits-archive@www.apache.org Delivered-To: apmail-manifoldcf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4E9EC10D2E for ; Thu, 9 Jan 2014 00:57:01 +0000 (UTC) Received: (qmail 78192 invoked by uid 500); 9 Jan 2014 00:57:01 -0000 Delivered-To: apmail-manifoldcf-commits-archive@manifoldcf.apache.org Received: (qmail 78150 invoked by uid 500); 9 Jan 2014 00:57:01 -0000 Mailing-List: contact commits-help@manifoldcf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@manifoldcf.apache.org Delivered-To: mailing list commits@manifoldcf.apache.org Received: (qmail 78138 invoked by uid 99); 9 Jan 2014 00:57:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jan 2014 00:57:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jan 2014 00:56:59 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 44FAD2388868; Thu, 9 Jan 2014 00:56:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1556689 - in /manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr: HttpPosterTest.java IngestThreadTest.java Date: Thu, 09 Jan 2014 00:56:39 -0000 To: commits@manifoldcf.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140109005639.44FAD2388868@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwright Date: Thu Jan 9 00:56:38 2014 New Revision: 1556689 URL: http://svn.apache.org/r1556689 Log: Various test fixes Modified: manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr/HttpPosterTest.java manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr/IngestThreadTest.java Modified: manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr/HttpPosterTest.java URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr/HttpPosterTest.java?rev=1556689&r1=1556688&r2=1556689&view=diff ============================================================================== --- manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr/HttpPosterTest.java (original) +++ manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr/HttpPosterTest.java Thu Jan 9 00:56:38 2014 @@ -65,7 +65,7 @@ public class HttpPosterTest throws Exception { - httpPosterToTest = spy(new HttpPoster( "zkHost", "collection1", 5000, 500, "update", "removePath", "statusPath", + httpPosterToTest = spy(new HttpPoster( "localhost", "collection1", 5000, 500, "update", "removePath", "statusPath", "allowAttributeName", "denyAttributeName", "idAttributeName", "modifiedDateAttributeName", "createdDateAttributeName", "indexedDateAttributeName", "fileNameAttributeName", "mimeTypeAttributeName", new Long( 5000 ), "true")); @@ -104,16 +104,16 @@ public class HttpPosterTest Mockito.doThrow(new RuntimeException()).when( mockIngestionThread ).run(); whenNew( HttpPoster.IngestThread.class).withArguments("Document Id", document, streamParam, true, sourceTargets,shareAcls, - shareDenyAcls, acls, denyAcls,commitWithin).thenReturn(mockIngestionThread); + shareDenyAcls, acls, denyAcls,commitWithin).thenReturn(mockIngestionThread); httpPosterToTest.indexPost("Document Id", document, streamParam, - sourceTargets,true, "AuthorityString",act); + sourceTargets,true, "AuthorityString",act); verifyNew(HttpPoster.IngestThread.class).withArguments("Document Id", document, streamParam, true, sourceTargets, shareAcls, - shareDenyAcls, acls, denyAcls, commitWithin ); + shareDenyAcls, acls, denyAcls, commitWithin ); } private void initRepositoryDocumentMock( String[] shareAcls, String[] shareDenyAcls, String[] acls, - String[] denyAcls ) + String[] denyAcls ) throws IOException { document = mock( RepositoryDocument.class ); Modified: manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr/IngestThreadTest.java URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr/IngestThreadTest.java?rev=1556689&r1=1556688&r2=1556689&view=diff ============================================================================== --- manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr/IngestThreadTest.java (original) +++ manifoldcf/branches/CONNECTORS-840/connectors/solr/connector/src/test/java/org/apache/manifoldcf/agents/output/solr/IngestThreadTest.java Thu Jan 9 00:56:38 2014 @@ -55,6 +55,7 @@ public class IngestThreadTest extends TestCase { + HttpPoster.IngestThread ingestThreadToTestKeepAllMetadata; HttpPoster.IngestThread ingestThreadToTest; HttpPoster poster; @@ -96,9 +97,12 @@ public class IngestThreadTest String[] denyAcls = new String[]{ "denyAcl1", "denyAcl2" }; String commitWithin = "true"; - ingestThreadToTest = spy( + ingestThreadToTestKeepAllMetadata = spy( poster.new IngestThread( "document id", document, streamParam, true, sourceTargets, shareAcls, shareDenyAcls, acls, denyAcls, commitWithin ) ); + ingestThreadToTest = spy( + poster.new IngestThread( "document id", document, streamParam, false, sourceTargets, shareAcls, + shareDenyAcls, acls, denyAcls, commitWithin ) ); } @@ -106,8 +110,8 @@ public class IngestThreadTest public void testIndexPostNotKeepMetadata() throws Exception { - this.indexPostNotKeepMetadata( true ); - this.indexPostNotKeepMetadata( false ); + this.indexPostNotKeepMetadata( ingestThreadToTestKeepAllMetadata, true ); + this.indexPostNotKeepMetadata( ingestThreadToTest, false ); } @@ -117,11 +121,9 @@ public class IngestThreadTest * @param keep * @throws Exception */ - private void indexPostNotKeepMetadata( Boolean keep ) + private void indexPostNotKeepMetadata( HttpPoster.IngestThread it, boolean keep ) throws Exception { - ingestThreadToTest.setKeepAllMetadata( keep ); - ContentStreamUpdateRequest contentStreamUpdateRequest = mock( ContentStreamUpdateRequest.class ); whenNew( ContentStreamUpdateRequest.class ).withArguments( anyString() ).thenReturn( contentStreamUpdateRequest ); @@ -129,7 +131,7 @@ public class IngestThreadTest when( contentStreamUpdateRequest.process( any( SolrServer.class ) ) ).thenReturn( mockResponse ); doCallRealMethod().when( contentStreamUpdateRequest ).setParams( any( ModifiableSolrParams.class ) ); doCallRealMethod().when( contentStreamUpdateRequest ).getParams(); - ingestThreadToTest.run(); + it.run(); verifyNew( ContentStreamUpdateRequest.class, atLeastOnce() ).withArguments( anyString() ); ModifiableSolrParams expectedParams = initExpectedSolrParams( keep ); @@ -166,7 +168,7 @@ public class IngestThreadTest * @return * @throws UnsupportedEncodingException */ - private ModifiableSolrParams initExpectedSolrParams( Boolean test2 ) + private ModifiableSolrParams initExpectedSolrParams( boolean test2 ) throws UnsupportedEncodingException { ModifiableSolrParams expectedParams = new ModifiableSolrParams();