Skip to content

Commit

Permalink
Merge branch 'feature/VDYP-163-VDYP-165' into feature/VDYP-164
Browse files Browse the repository at this point in the history
  • Loading branch information
smithkm committed Jul 21, 2023
2 parents c0c9d23 + abbea98 commit d95b4b8
Show file tree
Hide file tree
Showing 22 changed files with 288 additions and 224 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class BecDefinitionParserTest {

@Test
public void testParse() throws Exception {
void testParse() throws Exception {
var parser = new BecDefinitionParser();

var result = parser.parse(ControlFileParserTest.class, "coe/Becdef.dat", Collections.emptyMap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

import ca.bc.gov.nrs.vdyp.test.TestUtils;

public class BySpeciesDqCoefficientParserTest {
class BySpeciesDqCoefficientParserTest {

@Test
public void testParseSimple() throws Exception {
void testParseSimple() throws Exception {

var parser = new BySpeciesDqCoefficientParser();

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

import ca.bc.gov.nrs.vdyp.test.TestUtils;

public class CoefficientParserTest {
class CoefficientParserTest {

@Test
public void testParseSimple() throws Exception {
void testParseSimple() throws Exception {

var parser = new CoefficientParser("TEST");

Expand All @@ -37,7 +37,7 @@ public void testParseSimple() throws Exception {
}

@Test
public void testBadBec() throws Exception {
void testBadBec() throws Exception {

var parser = new CoefficientParser("TEST");

Expand All @@ -54,7 +54,7 @@ public void testBadBec() throws Exception {
}

@Test
public void testBadIndex() throws Exception {
void testBadIndex() throws Exception {

var parser = new CoefficientParser("TEST");

Expand All @@ -71,7 +71,7 @@ public void testBadIndex() throws Exception {
}

@Test
public void testParseDelta() throws Exception {
void testParseDelta() throws Exception {

var parser = new CoefficientParser("TEST");

Expand All @@ -91,7 +91,7 @@ public void testParseDelta() throws Exception {
}

@Test
public void testParseFixed() throws Exception {
void testParseFixed() throws Exception {

var parser = new CoefficientParser("TEST");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import ca.bc.gov.nrs.vdyp.model.Region;
import ca.bc.gov.nrs.vdyp.test.TestUtils;

public class ComponentSizeParserTest {
class ComponentSizeParserTest {

@Test
public void testParseSimpleP1() throws Exception {
void testParseSimpleP1() throws Exception {

var is = TestUtils.makeStream("S1 C 49.4 153.3 0.726 3.647");

Expand All @@ -33,7 +33,7 @@ public void testParseSimpleP1() throws Exception {
}

@Test
public void testParseBadSpecies() throws Exception {
void testParseBadSpecies() throws Exception {

var is = TestUtils.makeStream("SX C 49.4 153.3 0.726 3.647");

Expand All @@ -49,7 +49,7 @@ public void testParseBadSpecies() throws Exception {
}

@Test
public void testParseBadRegion() throws Exception {
void testParseBadRegion() throws Exception {

var is = TestUtils.makeStream("S1 X 49.4 153.3 0.726 3.647");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
import ca.bc.gov.nrs.vdyp.test.VdypMatchers;

@SuppressWarnings("unused")
public class EquationGroupParserTest {
class EquationGroupParserTest {

@Test
public void testParse() throws Exception {
void testParse() throws Exception {
var parser = new DefaultEquationNumberParser();

var controlMap = makeControlMapSingle();
Expand All @@ -45,7 +45,7 @@ public void testParse() throws Exception {
}

@Test
public void testSP0MustExist() throws Exception {
void testSP0MustExist() throws Exception {
var parser = new DefaultEquationNumberParser();

var controlMap = makeControlMapSingle();
Expand All @@ -63,7 +63,7 @@ public void testSP0MustExist() throws Exception {
}

@Test
public void testBecMustExist() throws Exception {
void testBecMustExist() throws Exception {
var parser = new DefaultEquationNumberParser();

var controlMap = makeControlMapSingle();
Expand All @@ -81,7 +81,7 @@ public void testBecMustExist() throws Exception {
}

@Test
public void testParseOvewrite() throws Exception {
void testParseOvewrite() throws Exception {
// Original Fortran allows subsequent entries to overwrite old ones so don't
// validate against that

Expand All @@ -97,7 +97,7 @@ public void testParseOvewrite() throws Exception {
}

@Test
public void testParseMultiple() throws Exception {
void testParseMultiple() throws Exception {
var parser = new DefaultEquationNumberParser();

var controlMap = makeControlMap();
Expand All @@ -118,7 +118,7 @@ public void testParseMultiple() throws Exception {
}

@Test
public void testRequireNoMissingSp0() throws Exception {
void testRequireNoMissingSp0() throws Exception {

var parser = new DefaultEquationNumberParser();

Expand All @@ -138,7 +138,7 @@ public void testRequireNoMissingSp0() throws Exception {
}

@Test
public void testRequireNoMissingBec() throws Exception {
void testRequireNoMissingBec() throws Exception {

var parser = new DefaultEquationNumberParser();

Expand All @@ -159,7 +159,7 @@ public void testRequireNoMissingBec() throws Exception {
}

@Test
public void testRequireNoUnexpectedBec() throws Exception {
void testRequireNoUnexpectedBec() throws Exception {

var parser = new DefaultEquationNumberParser();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package ca.bc.gov.nrs.vdyp.io.parse;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.is;

import java.util.HashMap;
import java.util.Map;

import org.junit.jupiter.api.Test;

import ca.bc.gov.nrs.vdyp.test.TestUtils;

class EquationModifierParserTest {

@Test
void testParseSimple() throws Exception {

var parser = new EquationModifierParser();

var is = TestUtils.makeStream(" 25 18 26");

Map<String, Object> controlMap = new HashMap<>();

var result = parser.parse(is, controlMap);

assertThat(result, hasEntry(is(25), hasEntry(is(18), is(26))));
// indexed
}

}
Loading

0 comments on commit d95b4b8

Please sign in to comment.