-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Issue #728: Adding asterisk for metadata transfer Signed-off-by: Michael Dinzinger <[email protected]> * Add method keySet(prefix) and metadata.copy Signed-off-by: Michael Dinzinger <[email protected]> * Add comments to crawler-default.yaml and add test cases for metadata.persist + transfer Signed-off-by: Michael Dinzinger <[email protected]> --------- Signed-off-by: Michael Dinzinger <[email protected]>
- Loading branch information
1 parent
5e8802f
commit 4d3340f
Showing
11 changed files
with
152 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
core/src/test/java/com/digitalpebble/stormcrawler/MetadataTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.digitalpebble.stormcrawler; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class MetadataTest { | ||
|
||
@Test | ||
public void testCopyWithPrefix() { | ||
Metadata metadata = new Metadata(); | ||
metadata.addValue("fetch.statusCode", "500"); | ||
metadata.addValue("fetch.error.count", "2"); | ||
metadata.addValue("fetch.exception", "java.lang.Exception"); | ||
metadata.addValue("fetchInterval", "200"); | ||
metadata.addValue("isFeed", "true"); | ||
metadata.addValue("depth", "1"); | ||
|
||
Metadata copy = new Metadata(); | ||
for (String key : metadata.keySet("fetch.")) { | ||
metadata.copy(copy, key); | ||
} | ||
|
||
Assert.assertEquals(3, copy.size()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters