1   package com.atlassian.bonnie.search.extractor;
2   
3   import com.atlassian.bonnie.search.Extractor;
4   
5   public class TestMsPowerpointContentExtractor extends BaseAttachmentContentExtractorTest
6   {
7   	private static final String[] POWERPOINT_IGNORED_WORDS = new String[]{"Master", "Second level", "Third level", "Fourth level", "Fifth level"};
8   
9   	public Extractor getExtractor()
10      {
11          return new MsPowerpointContentExtractor();
12      }
13  
14  	public void testSimplePowerpoint()
15  	{
16  		assertOnExtractedTextOf(createSearchableAttachment("test-attachment-search.ppt", "application/powerpoint"), new String[]{"Apple", "Fruit"}, new String[]{"feature"});
17  	}
18  
19  	public void testComplexPowerpoint()
20  	{
21  		assertOnExtractedTextOf(createSearchableAttachment("FeedOptimizationTips.ppt", "application/powerpoint"), new String[]{"Feed", "Optimization", "Tips", "Stock", "Availability"}, POWERPOINT_IGNORED_WORDS);
22  	}
23  
24  	public void testComplexPowerpoint2()
25  	{
26  		assertOnExtractedTextOf(createSearchableAttachment("Garrison6eCH01.ppt", "application/powerpoint"), new String[]{"Managerial", "Accounting", "Ethical", "Accounting"}, POWERPOINT_IGNORED_WORDS);
27  	}
28  
29  	// CONF-9833
30  	public void testJapanesePdf()
31  	{
32  		assertOnExtractedTextOf(createSearchableAttachment("simple-japanese.ppt", "application/powerpoint"), new String[]{"\u7e26\u5272", "Test file"}, POWERPOINT_IGNORED_WORDS);
33  	}
34  
35  }