Skip to content

Commit

Permalink
Tests completed and javadocs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
hkir-dev committed Mar 25, 2022
1 parent e9d0aa9 commit 4fbe1d0
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import java.util.regex.Pattern;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* A RegEx based link extractor for the 'DOI:' prefix.
* 25 Mar 2022
*/
public class DOILinkExtractor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import java.util.regex.Pattern;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* A RegEx based link extractor for the 'OMIM:' prefix.
* 25 Mar 2022
*/
public class OMIMLinkExtractor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import java.util.regex.Pattern;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* A RegEx based link extractor for the 'OMIMPS:' prefix.
* 25 Mar 2022
*/
public class OMIMPSLinkExtractor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import java.util.regex.Pattern;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* A RegEx based link extractor for the 'ORCID:' prefix.
* 25 Mar 2022
*/
public class ORCIDLinkExtractor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import java.util.regex.Pattern;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* A RegEx based link extractor for the 'Orphanet:' prefix.
* 25 Mar 2022
*/
public class OrphanetLinkExtractor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import java.util.regex.Pattern;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* A RegEx based link extractor for the 'WikipediaVersioned:' prefix.
* 25 Mar 2022
*/
public class WikipediaVersionedLinkExtractor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
import static org.hamcrest.core.Is.is;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* Unit tests for the DOI link extraction.
* 25 Mar 2022
*/
public class DOILinkExtractor_TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
import static org.hamcrest.core.Is.is;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* Unit tests for the OMIM link extraction.
* 25 Mar 2022
*/
public class OMIMLinkExtractor_TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
import static org.hamcrest.core.Is.is;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* Unit tests for the OMIMPS link extraction.
* 25 Mar 2022
*/
public class OMIMPSLinkExtractor_TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
import static org.hamcrest.core.Is.is;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* Unit tests for the ORCID link extraction.
* 25 Mar 2022
*/
public class ORCIDLinkExtractor_TestCase {

Expand All @@ -33,14 +32,14 @@ public void shouldExtractId() {
public void shouldIgnoreCase_AllLowerCase() {
String id = "orcid:0000-0001-7258-9596";
Optional<String> extractedId = extractor.extractLinkLiteral(id);
assertThat(extractedId, is(Optional.of(DOILinkExtractor.DOI_URL_BASE + "0000-0001-7258-9596")));
assertThat(extractedId, is(Optional.of(ORCIDLinkExtractor.ORCID_URL_BASE + "0000-0001-7258-9596")));
}

@Test
public void shouldIgnoreCase_MixedCase() {
String id = "Orcid:0000-0001-7258-9596";
Optional<String> extractedId = extractor.extractLinkLiteral(id);
assertThat(extractedId, is(Optional.of(DOILinkExtractor.DOI_URL_BASE + "0000-0001-7258-9596")));
assertThat(extractedId, is(Optional.of(ORCIDLinkExtractor.ORCID_URL_BASE + "0000-0001-7258-9596")));
}

@Test
Expand All @@ -54,7 +53,7 @@ public void shouldNotExtractIdInCaseOfMissingPrefix() {
public void shouldAllowWhiteSpaceAfterPrefix() {
String id = "orcid: 0000-0001-7258-9596";
Optional<String> extractedId = extractor.extractLinkLiteral(id);
assertThat(extractedId, is(Optional.of(DOILinkExtractor.DOI_URL_BASE + "0000-0001-7258-9596")));
assertThat(extractedId, is(Optional.of(ORCIDLinkExtractor.ORCID_URL_BASE + "0000-0001-7258-9596")));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
import static org.hamcrest.core.Is.is;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* Unit tests for the orphanet link extraction.
* 25 Mar 2022
*/
public class OrphanetLinkExtractor_TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
import static org.hamcrest.core.Is.is;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 18 Aug 16
* Unit tests for the WikipediaVersioned link extraction.
* 25 Mar 2022
*/
public class WikipediaVersionedLinkExtractor_TestCase {

Expand Down

0 comments on commit 4fbe1d0

Please sign in to comment.