Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #81 from dnorgaard-usgs/master
Browse files Browse the repository at this point in the history
hande SCNL with space delimiters
  • Loading branch information
Diana Norgaard committed Jul 26, 2018
2 parents ac7ff56 + 26bbab4 commit 2ff2b31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>gov.usgs.volcanoes</groupId>
<artifactId>volcano-core</artifactId>
<version>1.4.8</version>
<version>1.4.9</version>
<packaging>jar</packaging>

<name>volcano-core</name>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/gov/usgs/volcanoes/core/data/Scnl.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ public String toString(String delimiter) {
* @throws UtilException when string cannot be parsed
*/
public static Scnl parse(String scnlString) throws UtilException {
if (scnlString.indexOf("$") == -1) {
return Scnl.parse(scnlString, " ");
}
return Scnl.parse(scnlString, DELIMITER);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.martiansoftware.jsap.ParseException;

import gov.usgs.volcanoes.core.args.parser.ScnlParser;
import gov.usgs.volcanoes.core.data.Scnl;
import gov.usgs.volcanoes.core.data.ScnlTest;

import org.junit.Test;

/**
*
Expand Down Expand Up @@ -65,6 +63,6 @@ public void when_givenScn_return_scn() throws ParseException {
*/
@Test(expected = ParseException.class)
public void when_givenBadScnl_then_throwHelpfulException() throws ParseException {
parser.parse("not a SCNL");
parser.parse("not-a-SCNL");
}
}

0 comments on commit 2ff2b31

Please sign in to comment.