-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Order validator output. Add condition 320 azimuth dip condition.
- Loading branch information
timronan
committed
Apr 9, 2020
1 parent
0d1cd23
commit 14d82eb
Showing
9 changed files
with
1,394 additions
and
132 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
77 changes: 77 additions & 0 deletions
77
src/test/java/edu/iris/dmc/station/conditions/Condition320Test.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,77 @@ | ||
package edu.iris.dmc.station.conditions; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.io.InputStream; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import edu.iris.dmc.DocumentMarshaller; | ||
import edu.iris.dmc.fdsn.station.model.Channel; | ||
import edu.iris.dmc.fdsn.station.model.FDSNStationXML; | ||
import edu.iris.dmc.fdsn.station.model.Network; | ||
import edu.iris.dmc.fdsn.station.model.Station; | ||
import edu.iris.dmc.station.RuleEngineServiceTest; | ||
import edu.iris.dmc.station.conditions.EpochRangeCondition; | ||
import edu.iris.dmc.station.conditions.StartTimeCondition; | ||
import edu.iris.dmc.station.rules.Message; | ||
|
||
public class Condition320Test { | ||
|
||
private FDSNStationXML theDocument; | ||
|
||
@BeforeEach | ||
public void init() throws Exception { | ||
|
||
} | ||
|
||
@Test | ||
public void azimuthfail() throws Exception { | ||
try (InputStream is = RuleEngineServiceTest.class.getClassLoader().getResourceAsStream("F1_320.xml")) { | ||
theDocument = DocumentMarshaller.unmarshal(is); | ||
|
||
Network n = theDocument.getNetwork().get(0); | ||
Station s = n.getStations().get(0); | ||
Channel c = s.getChannels().get(0); | ||
|
||
AzimuthDipCondition condition = new AzimuthDipCondition(true, ""); | ||
Message result = condition.evaluate(c); | ||
assertTrue(result instanceof edu.iris.dmc.station.rules.Error); | ||
} | ||
|
||
} | ||
|
||
@Test | ||
public void dipfail() throws Exception { | ||
try (InputStream is = RuleEngineServiceTest.class.getClassLoader().getResourceAsStream("F2_320.xml")) { | ||
theDocument = DocumentMarshaller.unmarshal(is); | ||
|
||
Network n = theDocument.getNetwork().get(0); | ||
Station s = n.getStations().get(0); | ||
Channel c = s.getChannels().get(0); | ||
|
||
AzimuthDipCondition condition = new AzimuthDipCondition(true, ""); | ||
Message result = condition.evaluate(c); | ||
assertTrue(result instanceof edu.iris.dmc.station.rules.Error); | ||
} | ||
|
||
} | ||
|
||
@Test | ||
public void pass() throws Exception { | ||
try (InputStream is = RuleEngineServiceTest.class.getClassLoader().getResourceAsStream("pass.xml")) { | ||
theDocument = DocumentMarshaller.unmarshal(is); | ||
|
||
Network n = theDocument.getNetwork().get(0); | ||
Station s = n.getStations().get(0); | ||
|
||
EpochRangeCondition condition = new EpochRangeCondition(true, ""); | ||
|
||
Message result = condition.evaluate(s); | ||
assertTrue(result instanceof edu.iris.dmc.station.rules.Success); | ||
} | ||
|
||
} | ||
} | ||
|
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
Oops, something went wrong.