Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
- Extract Development - Data Collection Service (DCS) Extractor
- Getting Started with Data Collection Service (DCS) Extractor
- Extractor
- Integration Architecture
- Extractor Prerequisite
- Step by Step Development of a Java-based Extractor
- 1. Create a Content Pack with IDE
- 2. Unzip, deploy, and install the Content Pack in BA
- 3. Create a Java Project and Include Dependencies
- 4. Implement the Extractor
- 5. Create a Unit Test to Check the Extractor
- 6. Package the Extractor as a JAR File
- 7. Copy and Deploy the Extractor
- 8. Modify the extractor_manifest.xml File
- 9. Add a New Data Source for the Content Pack in BA
- 10. Run ETL
- Extractor API
- Out-of-the-Box General Extractors
- Configure the Connect Data Source UI for BA Integration
5. Create a Unit Test to Check the Extractor
Create a unit test so that your extractor can be work fine.
Test the Extractor (Unit Test)
You can write a unit test to test your extractor to check that your extractor works. In the test, you must inject a dummy IExtractorMetadata instance. The IExtractorMetadata is used for initialization by the extractor. The dummy instance provides the extractor with information such as CP name, data source type, product version, connection property details and so on.
If required, download and import the Junit and EasyMock library to your project from the following sites:
package com.hp.itba.dwh.extractors.sample.test; import java.io.File; import java.util.ArrayList; import java.util.List; import junit.framework.Assert; import org.easymock.EasyMock; import org.easymock.IMocksControl; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import com.hp.itba.dwh.dcs.api.IDataSource; import com.hp.itba.dwh.dcs.api.IExtractor; import com.hp.itba.dwh.dcs.api.IExtractorMetadata; import com.hp.itba.dwh.dcs.exception.ExtractorException; import com.hp.itba.dwh.extractor.test.SampleExtractor; public class SampleExtractorTest { static IExtractor extractor; public static void setup() { extractor = new SampleExtractor(); IMocksControl control = EasyMock.createControl(); IExtractorMetadata metadata = control.createMock(IExtractorMetadata.class);
EasyMock.expect(metadata.getCpName()).andReturn("Sample").anyTimes();
EasyMock.expect(metadata.getDataSourceType()).andReturn("generic").anyTimes(); EasyMock.expect(metadata.getProductVersion()).andReturn("1.0").anyTimes(); EasyMock.expect(metadata.getFieldDelimiter()).andReturn("|").anyTimes(); EasyMock.expect(metadata.getRowDelimiter()).andReturn("#").anyTimes(); EasyMock.expect(metadata.getOutputPath()).andReturn(new File ("output").getAbsolutePath()).anyTimes(); IDataSource ds = control.createMock(IDataSource.class); List<String[]> value = new ArrayList<String[]>(); value.add(new String[] {"productName", "Sample", "false"}); //… EasyMock.expect(ds.getConnProperties()).andReturn(value).anyTimes(); EasyMock.expect(metadata.getDataSource()).andReturn(ds).anyTimes(); EasyMock.expectLastCall().anyTimes(); control.replay(); try { extractor.init("sample_1", metadata); // extractor.setDbHelper(dbHelper); } catch (ExtractorException e) { Assert.fail(e.getMessage()); } } public void testCheckConnection() { try { extractor.checkConnection(); } catch (ExtractorException e) { Assert.fail(e.getMessage()); } } public void testExtract() { try { extractor.extract("1", null); } catch (ExtractorException e) { Assert.fail(e.getMessage()); } } }
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to SW-Doc@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback: