target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void addShouldCreateAnewListAndRegisterItAsAttributeWhenTheAttributeDoesNotExist() { given(commandContext.getGenericAttribute(MessageProducerCommandContextCloseListener.PROCESS_ENGINE_EVENTS)).willReturn(null); eventsAggregator.add(event); verify(commandContext).addAttribute(eq(MessageProducerCommandContex... | @Override public void add(CloudRuntimeEvent<?, ?> element) { CommandContext commandContext = getCurrentCommandContext(); String executionId = resolveExecutionId(element); ExecutionContext executionContext = resolveExecutionContext(commandContext, executionId); if(executionContext != null) { ExecutionContextInfoAppender... | ProcessEngineEventsAggregator extends BaseCommandContextEventsAggregator<CloudRuntimeEvent<?,?>, MessageProducerCommandContextCloseListener> { @Override public void add(CloudRuntimeEvent<?, ?> element) { CommandContext commandContext = getCurrentCommandContext(); String executionId = resolveExecutionId(element); Execut... | ProcessEngineEventsAggregator extends BaseCommandContextEventsAggregator<CloudRuntimeEvent<?,?>, MessageProducerCommandContextCloseListener> { @Override public void add(CloudRuntimeEvent<?, ?> element) { CommandContext commandContext = getCurrentCommandContext(); String executionId = resolveExecutionId(element); Execut... | ProcessEngineEventsAggregator extends BaseCommandContextEventsAggregator<CloudRuntimeEvent<?,?>, MessageProducerCommandContextCloseListener> { @Override public void add(CloudRuntimeEvent<?, ?> element) { CommandContext commandContext = getCurrentCommandContext(); String executionId = resolveExecutionId(element); Execut... | ProcessEngineEventsAggregator extends BaseCommandContextEventsAggregator<CloudRuntimeEvent<?,?>, MessageProducerCommandContextCloseListener> { @Override public void add(CloudRuntimeEvent<?, ?> element) { CommandContext commandContext = getCurrentCommandContext(); String executionId = resolveExecutionId(element); Execut... |
@Test public void testOutputFile() throws FileNotFoundException, IOException { final String csvFileName = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + BLANK_LINE_CSV; final String outFileName = System.getProperty("user.dir") + File.s... | public static void main(String[] args) throws IOException { if (args.length != 2) { System.out.println("Usage java " + Score.class.getName() + " <FILENAME>.csv <SCORE.csv>"); return; } final String csvFileName = args[0]; File csvFile = new File(csvFileName); if (!csvFile.exists()) { System.err.println("File " + csvFile... | Score { public static void main(String[] args) throws IOException { if (args.length != 2) { System.out.println("Usage java " + Score.class.getName() + " <FILENAME>.csv <SCORE.csv>"); return; } final String csvFileName = args[0]; File csvFile = new File(csvFileName); if (!csvFile.exists()) { System.err.println("File " +... | Score { public static void main(String[] args) throws IOException { if (args.length != 2) { System.out.println("Usage java " + Score.class.getName() + " <FILENAME>.csv <SCORE.csv>"); return; } final String csvFileName = args[0]; File csvFile = new File(csvFileName); if (!csvFile.exists()) { System.err.println("File " +... | Score { public static void main(String[] args) throws IOException { if (args.length != 2) { System.out.println("Usage java " + Score.class.getName() + " <FILENAME>.csv <SCORE.csv>"); return; } final String csvFileName = args[0]; File csvFile = new File(csvFileName); if (!csvFile.exists()) { System.err.println("File " +... | Score { public static void main(String[] args) throws IOException { if (args.length != 2) { System.out.println("Usage java " + Score.class.getName() + " <FILENAME>.csv <SCORE.csv>"); return; } final String csvFileName = args[0]; File csvFile = new File(csvFileName); if (!csvFile.exists()) { System.err.println("File " +... |
@Test public void test1() throws IOException { Main.main(new String[] {}); } | public static void main(String[] args) throws IOException { BenchmarkCollection bmcollection = null; String toolName = null, benchmark = null; IBenchmarkTask task = null; File toolDirectory = null; int runNumber = -1; int timeBudget = -1; String mode = null; if (BENCHMARK_CONFIG != null) { try { bmcollection = new Benc... | Main { public static void main(String[] args) throws IOException { BenchmarkCollection bmcollection = null; String toolName = null, benchmark = null; IBenchmarkTask task = null; File toolDirectory = null; int runNumber = -1; int timeBudget = -1; String mode = null; if (BENCHMARK_CONFIG != null) { try { bmcollection = n... | Main { public static void main(String[] args) throws IOException { BenchmarkCollection bmcollection = null; String toolName = null, benchmark = null; IBenchmarkTask task = null; File toolDirectory = null; int runNumber = -1; int timeBudget = -1; String mode = null; if (BENCHMARK_CONFIG != null) { try { bmcollection = n... | Main { public static void main(String[] args) throws IOException { BenchmarkCollection bmcollection = null; String toolName = null, benchmark = null; IBenchmarkTask task = null; File toolDirectory = null; int runNumber = -1; int timeBudget = -1; String mode = null; if (BENCHMARK_CONFIG != null) { try { bmcollection = n... | Main { public static void main(String[] args) throws IOException { BenchmarkCollection bmcollection = null; String toolName = null, benchmark = null; IBenchmarkTask task = null; File toolDirectory = null; int runNumber = -1; int timeBudget = -1; String mode = null; if (BENCHMARK_CONFIG != null) { try { bmcollection = n... |
@Test void shouldSkipFileIfItsExcluded() { final String ignoredFilename = "empty-as-well.dmn"; testee.setExcludes(new String[] { ignoredFilename }); final List<File> filesToTest = testee.fetchFilesToTestFromSearchPaths(Collections.singletonList(Paths.get(""))); Assertions.assertTrue(filesToTest.stream().noneMatch(file ... | void setExcludes(final String[] excludes) { this.excludes = excludes; } | CheckerMain extends AbstractMojo implements PluginBase { void setExcludes(final String[] excludes) { this.excludes = excludes; } } | CheckerMain extends AbstractMojo implements PluginBase { void setExcludes(final String[] excludes) { this.excludes = excludes; } } | CheckerMain extends AbstractMojo implements PluginBase { void setExcludes(final String[] excludes) { this.excludes = excludes; } @Override void execute(); @Override PrettyPrintValidationResults.PluginLogger getPluginLogger(); @Override List<String> getExcludeList(); @Override List<String> getSearchPathList(); @Overrid... | CheckerMain extends AbstractMojo implements PluginBase { void setExcludes(final String[] excludes) { this.excludes = excludes; } @Override void execute(); @Override PrettyPrintValidationResults.PluginLogger getPluginLogger(); @Override List<String> getExcludeList(); @Override List<String> getSearchPathList(); @Overrid... |
@Test void variableThatDoesNotContainVariable() { assertFalse(FeelExpressions.VariableLiteral("y").containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void rangeContainsVariable() { assertTrue(FeelExpressions.RangeExpression(true, FeelExpressions.VariableLiteral("x"), FeelExpressions.Empty(), false) .containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void rangeDoesNotContainVariable() { assertFalse(FeelExpressions.RangeExpression(true, FeelExpressions.VariableLiteral("y"), FeelExpressions.Empty(), false) .containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void unaryContainsVariable() { assertTrue(FeelExpressions.UnaryExpression(Operator.GT, FeelExpressions.VariableLiteral("x")).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void unaryDoesNotContainVariable() { assertFalse(FeelExpressions.UnaryExpression(Operator.GT, FeelExpressions.VariableLiteral("y")).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void binaryContainsVariable() { assertTrue(FeelExpressions.BinaryExpression(FeelExpressions.Empty(), Operator.GT, FeelExpressions.VariableLiteral("x")).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void binaryDosNotContainVariable() { assertFalse(FeelExpressions.BinaryExpression(FeelExpressions.Empty(), Operator.GT, FeelExpressions.VariableLiteral("y")).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void disjunctionContainsVariableInTail() { assertTrue(FeelExpressions.DisjunctionExpression(FeelExpressions.Empty(), FeelExpressions.VariableLiteral("x")).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void disjunctionContainsVariableInHead() { assertTrue(FeelExpressions.DisjunctionExpression(FeelExpressions.VariableLiteral("x"), FeelExpressions.Empty()).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void disjunctionDosNotContainVariableInTail() { assertFalse(FeelExpressions.DisjunctionExpression(FeelExpressions.Empty(), FeelExpressions.VariableLiteral("y")).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void shouldDetectIfFileIsOnSearchPath() { testee.setSearchPaths(new String[] {"src/"}); final MojoExecutionException assertionError = Assertions.assertThrows(MojoExecutionException.class, testee::execute); Assertions.assertTrue(assertionError.getMessage().contains("Some files are not valid, see previous logs."));... | void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } | CheckerMain extends AbstractMojo implements PluginBase { void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } } | CheckerMain extends AbstractMojo implements PluginBase { void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } } | CheckerMain extends AbstractMojo implements PluginBase { void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } @Override void execute(); @Override PrettyPrintValidationResults.PluginLogger getPluginLogger(); @Override List<String> getExcludeList(); @Override List<String> getSearchPathList... | CheckerMain extends AbstractMojo implements PluginBase { void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } @Override void execute(); @Override PrettyPrintValidationResults.PluginLogger getPluginLogger(); @Override List<String> getExcludeList(); @Override List<String> getSearchPathList... |
@Test void disjunctionDoesNotContainVariableInHead() { assertFalse(FeelExpressions.DisjunctionExpression(FeelExpressions.VariableLiteral("y"), FeelExpressions.Empty()).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void emptyHasTypeTop() { final FeelExpression expression = FeelParser.PARSER.parse(""); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(right(ExpressionTypes.TOP()), type); } | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void integerHasTypeInteger() { final FeelExpression expression = FeelParser.PARSER.parse("42"); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(right(ExpressionTypes.INTEGER()), type); } | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void doubleHasTypeDouble() { final FeelExpression expression = FeelParser.PARSER.parse("3.14159265359"); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(right(ExpressionTypes.DOUBLE()), type); } | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void stringHasTypeString() { final FeelExpression expression = FeelParser.PARSER.parse("\"Steak\""); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(right(ExpressionTypes.STRING()), type); } | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void dateHasTypeDate() { final FeelExpression expression = FeelParser.PARSER.parse("date and time(\"2015-11-30T12:00:00\")"); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(right(ExpressionTypes.DATE()), type); } | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void boundVariableHasType() { final FeelExpression expression = FeelParser.PARSER.parse("x"); final FeelTypecheck.Context context = new FeelTypecheck.Context(); context.put("x", ExpressionTypes.INTEGER()); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(context, e... | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void unboundVariableHasNoType() { final FeelExpression expression = FeelParser.PARSER.parse("x"); final FeelTypecheck.Context context = new FeelTypecheck.Context(); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(context, expression); assertEquals(Optional.empty()... | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void lessThanExpressionIsNotTypeableForStrings() { final FeelExpression expression = FeelParser.PARSER.parse("<\"Steak\""); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(Optional.empty(), Eithers.getRight(type)); assertEquals("Operator ... | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void additionOfIntegersIsTypeable() { final FeelExpression expression = FeelParser.PARSER.parse("3+4"); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(right(ExpressionTypes.INTEGER()), type); } | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void shouldDetectIfFileIsOnSearchPathWithMultiplePaths() { testee.setSearchPaths(new String[] {"src/main/java","src/"}); final MojoExecutionException assertionError = Assertions.assertThrows(MojoExecutionException.class, testee::execute); Assertions.assertTrue(assertionError.getMessage().contains("Some files are ... | void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } | CheckerMain extends AbstractMojo implements PluginBase { void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } } | CheckerMain extends AbstractMojo implements PluginBase { void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } } | CheckerMain extends AbstractMojo implements PluginBase { void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } @Override void execute(); @Override PrettyPrintValidationResults.PluginLogger getPluginLogger(); @Override List<String> getExcludeList(); @Override List<String> getSearchPathList... | CheckerMain extends AbstractMojo implements PluginBase { void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } @Override void execute(); @Override PrettyPrintValidationResults.PluginLogger getPluginLogger(); @Override List<String> getExcludeList(); @Override List<String> getSearchPathList... |
@Test void additionOfIntegerAndStringIsNotTypeable() { final FeelExpression expression = FeelParser.PARSER.parse("2+\"foo\""); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(Optional.empty(), Eithers.getRight(type)); assertEquals("Types of lef... | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void disjunctionOfComparisonsIsTypeable() { final FeelExpression expression = FeelParser.PARSER.parse("<3,>8"); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(right(ExpressionTypes.INTEGER()), type); } | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void disjunctionOfComparisonAndStringIsNotTypeable() { final FeelExpression expression = FeelParser.PARSER.parse("<3,\"foo\""); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(Optional.empty(), Eithers.getRight(type)); assertEquals("Types... | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void rangeOfIntegersIsWellTyped() { final FeelExpression expression = FeelParser.PARSER.parse("[3..42]"); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(right(ExpressionTypes.INTEGER()), type); } | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void rangeFromIntegerToDoubleIsNotTypeable() { final FeelExpression expression = FeelParser.PARSER.parse("[1..1.5]"); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(Optional.empty(), Eithers.getRight(type)); assertEquals("Types of lower ... | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void rangeExpressionContainingStringsIsIlltyped() { final FeelExpression expression = FeelParser.PARSER.parse("[\"A\"..\"Z\"]"); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(Optional.empty(), Eithers.getRight(type)); assertEquals("Type... | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void notExpressionContainingTrueIsTypable() { final FeelExpression expression = FeelParser.PARSER.parse("not(true)"); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(right(ExpressionTypes.BOOLEAN()), type); } | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void notExpressionContainingDisjunctionWithStringsIsTypable() { final FeelExpression expression = FeelParser.PARSER.parse("not(\"foo\", \"bar\")"); final Either<ValidationResult.Builder.ElementStep, ExpressionType> type = FeelTypecheck.typecheck(expression); assertEquals(right(ExpressionTypes.STRING()), type); } | public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); } | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... | FeelTypecheck { public static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression) { return typecheck(new Context(), expression); } private FeelTypecheck(); static Either<ValidationResult.Builder.ElementStep, ExpressionType> typecheck(final FeelExpression expression);... |
@Test void emptySubsumesEmpty() { final FeelExpression emptyExpression = FeelExpressions.Empty(); assertEquals(Optional.of(true), Subsumption.subsumes(emptyExpression, emptyExpression, Subsumption.eq)); } | static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false))) .BooleanLit... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... |
@Test void nullSubsumesNull() { final FeelExpression nullExpression = FeelExpressions.Null(); assertEquals(Optional.of(true), Subsumption.subsumes(nullExpression, nullExpression, Subsumption.eq)); } | static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false))) .BooleanLit... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... |
@Test void emptyNeverContainsVariable() { assertFalse(FeelExpressions.Empty().containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void identicalStringsSubsumeEachOther() { final FeelExpression stringExpression = FeelParser.PARSER.parse("\"somestring\""); assertEquals(Optional.of(true), Subsumption.subsumes(stringExpression, stringExpression, Subsumption.eq)); } | static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false))) .BooleanLit... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... |
@Test void differentStringsDoNotSubsumeEachOther() { final FeelExpression stringExpression = FeelParser.PARSER.parse("\"somestring\""); final FeelExpression otherStringExpression = FeelParser.PARSER.parse("\"otherstring\""); assertEquals(Optional.of(false), Subsumption.subsumes(stringExpression, otherStringExpression, ... | static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false))) .BooleanLit... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... | Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Optional.of(false)... |
@Test void shouldParseEmpty() { final FeelExpression expression = FeelParser.PARSER.parse(""); final FeelExpression expectedExpression = Empty(); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseEmptyRepresentedAsDash() { final FeelExpression expression = FeelParser.PARSER.parse("-"); final FeelExpression expectedExpression = Empty(); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseNumberLiterals() { final FeelExpression expression = FeelParser.PARSER.parse("42"); final FeelExpression expectedExpression = IntegerLiteral(42); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseVariableLiteral() { final FeelExpression expression = FeelParser.PARSER.parse("foobar"); final FeelExpression expectedExpression = VariableLiteral("foobar"); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseDoubleLiteral() { final FeelExpression expression = FeelParser.PARSER.parse(String.valueOf(Math.PI)); final FeelExpression expectedExpression = FeelExpressions.DoubleLiteral(Math.PI); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseNull() { final FeelExpression expression = FeelParser.PARSER.parse("null"); final FeelExpression expectedExpression = Null(); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseVariableLiteralWithAttribute() { final FeelExpression expression = FeelParser.PARSER.parse("foo.bar"); final FeelExpression expectedExpression = VariableLiteral("foo.bar"); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseEmptyStringLiteral() { final FeelExpression expression = FeelParser.PARSER.parse("\"\""); final FeelExpression expectedExpression = FeelExpressions.StringLiteral(""); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void boolNeverContainsVariable() { assertFalse(FeelExpressions.BooleanLiteral(true).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void shouldParseStringLiteral() { final FeelExpression expression = FeelParser.PARSER.parse("\"Steak\""); final FeelExpression expectedExpression = FeelExpressions.StringLiteral("Steak"); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseStringLiteralContainingSpecialCharacters() { final FeelExpression expression = FeelParser.PARSER.parse("\"x.y.z=false\""); final FeelExpression expectedExpression = FeelExpressions.StringLiteral("x.y.z=false"); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseNegativeNumbers() { final FeelExpression expression = FeelParser.PARSER.parse("- 3"); final FeelExpression expectedExpression = UnaryExpression(Operator.SUB, IntegerLiteral(3)); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldNotParseDashWithinExpressionsAsEmpty() { assertThrows(ParserException.class, () -> FeelParser.PARSER.parse("2 * -")); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldHandleWhitespaceCorrectly() { final FeelExpression expression = FeelParser.PARSER.parse("2 * 3"); final FeelExpression expectedExpression = BinaryExpression( IntegerLiteral(2), Operator.MUL, IntegerLiteral(3) ); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseArithmeticExpressionWithVariable() { final FeelExpression expression = FeelParser.PARSER.parse("4 + x"); final FeelExpression expectedExpression = BinaryExpression( IntegerLiteral(4), Operator.ADD, VariableLiteral("x") ); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseComparisonExpressionWithVariable() { final FeelExpression expression = FeelParser.PARSER.parse("> y"); final FeelExpression expectedExpression = UnaryExpression(Operator.GT, VariableLiteral("y")); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseDoublesInRangeExpression() { final FeelExpression expression = FeelParser.PARSER.parse("[0.5..1.5]"); final FeelExpression expectedExpression = RangeExpression(true, DoubleLiteral(0.5), DoubleLiteral(1.5), true); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseRangeExpressionWithVariable() { final FeelExpression expression = FeelParser.PARSER.parse("[1..x]"); final FeelExpression expectedExpression = RangeExpression(true, IntegerLiteral(1), VariableLiteral("x"), true); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseDisjunctionExpressionWithComparisons() { final FeelExpression expression = FeelParser.PARSER.parse("<3,>100,42"); final FeelExpression expectedExpression = DisjunctionExpression( UnaryExpression(Operator.LT, IntegerLiteral(3)), DisjunctionExpression(UnaryExpression(Operator.GT, IntegerLiteral(100)... | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void dateNeverContainsVariable() { assertFalse(FeelExpressions.DateLiteral(LocalDateTime.MIN).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void shouldParseDisjunctionExpressionWithStrings() { final FeelExpression expression = FeelParser.PARSER.parse("\"Spareribs\",\"Steak\",\"Stew\""); final FeelExpression expectedExpression = DisjunctionExpression( StringLiteral("Spareribs"), DisjunctionExpression(StringLiteral("Steak"), StringLiteral("Stew"))); as... | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseDisjunctionExpressionWithVariable() { final FeelExpression expression = FeelParser.PARSER.parse(">customer.age,>21"); final FeelExpression expectedExpression = DisjunctionExpression( UnaryExpression(Operator.GT, VariableLiteral("customer.age")), UnaryExpression(Operator.GT, IntegerLiteral(21))); a... | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseDisjunctionExpressionWithRanges() { final FeelExpression expression = FeelParser.PARSER.parse("[1..2],[5..6],[8..10]"); final FeelExpression expectedExpression = DisjunctionExpression( RangeExpression(true, IntegerLiteral(1), IntegerLiteral(2), true), DisjunctionExpression( RangeExpression(true, I... | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseDisjunctionWithMixedExpressions() { final FeelExpression expression = FeelParser.PARSER.parse("10,[20..30],>10,42"); final FeelExpression expectedExpression = DisjunctionExpression( IntegerLiteral(10), DisjunctionExpression( RangeExpression(true, IntegerLiteral(20), IntegerLiteral(30), true), Disj... | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseExpressionContainingNot() { final FeelExpression expression = FeelParser.PARSER.parse("not([1..4],[6..9])"); final FeelExpression expectedExpression = UnaryExpression(Operator.NOT, DisjunctionExpression( RangeExpression(true, IntegerLiteral(1), IntegerLiteral(4), true), RangeExpression(true, Integ... | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldNotParseNestedNegations() { final Throwable throwable = assertThrows(ParserException.class, () -> FeelParser.PARSER.parse("not(not(true))")); assertEquals("Negations cannot be nested in FEEL expressions.\nline 1, column 15", throwable.getMessage()); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseDateExpression() { final FeelExpression expression = FeelParser.PARSER.parse("date and time(\"2015-11-30T12:00:00\")"); final FeelExpression expectedExpression = DateLiteral(LocalDateTime.of(2015, Month.NOVEMBER, 30, 12, 0)); assertEquals(expectedExpression, expression); } | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldParseDateExpressionsInRange() { final FeelExpression expression = FeelParser.PARSER.parse( "[date and time(\"2015-11-30T12:00:00\")..date and time(\"2015-12-01T12:00:00\")]"); final FeelExpression expectedExpression = RangeExpression(true, DateLiteral(LocalDateTime.of(2015, Month.NOVEMBER, 30, 12, 0)),... | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void shouldTreatParsingErrorsAsValidationErrors() { final Either<ValidationResult.Builder.ElementStep, FeelExpression> result = FeelParser.parse("[1.."); final String expectedErrorMessage = "Could not parse '[1..': line 1, column 5:\n" + "INTEGER, DECIMAL, booleanfragment, variablefragment, stringfragment or date... | public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage()));... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... | FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.ge... |
@Test void emptyGraphFromEmptyModel() { final DmnModelInstance emptyModel = Dmn.createEmptyModel(); final RequirementGraph requirementGraph = RequirementGraph.from(emptyModel); assertTrue(requirementGraph.vertexSet().isEmpty()); assertTrue(requirementGraph.edgeSet().isEmpty()); } | public static RequirementGraph from(final DmnModelInstance dmnModelInstance) throws IllegalArgumentException { final Collection<Decision> decisions = dmnModelInstance.getModelElementsByType(Decision.class); final Collection<KnowledgeSource> knowledgeSources = dmnModelInstance.getModelElementsByType(KnowledgeSource.clas... | RequirementGraph extends DirectedAcyclicGraph<DrgElement, DefaultEdge> { public static RequirementGraph from(final DmnModelInstance dmnModelInstance) throws IllegalArgumentException { final Collection<Decision> decisions = dmnModelInstance.getModelElementsByType(Decision.class); final Collection<KnowledgeSource> knowle... | RequirementGraph extends DirectedAcyclicGraph<DrgElement, DefaultEdge> { public static RequirementGraph from(final DmnModelInstance dmnModelInstance) throws IllegalArgumentException { final Collection<Decision> decisions = dmnModelInstance.getModelElementsByType(Decision.class); final Collection<KnowledgeSource> knowle... | RequirementGraph extends DirectedAcyclicGraph<DrgElement, DefaultEdge> { public static RequirementGraph from(final DmnModelInstance dmnModelInstance) throws IllegalArgumentException { final Collection<Decision> decisions = dmnModelInstance.getModelElementsByType(Decision.class); final Collection<KnowledgeSource> knowle... | RequirementGraph extends DirectedAcyclicGraph<DrgElement, DefaultEdge> { public static RequirementGraph from(final DmnModelInstance dmnModelInstance) throws IllegalArgumentException { final Collection<Decision> decisions = dmnModelInstance.getModelElementsByType(Decision.class); final Collection<KnowledgeSource> knowle... |
@Test void doubleNeverContainsVariable() { assertFalse(FeelExpressions.DoubleLiteral(0.0).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void intNeverContainsVariable() { assertFalse(FeelExpressions.IntegerLiteral(1).containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void stringNeverContainsVariable() { assertFalse(FeelExpressions.StringLiteral("foobar").containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test void variableThatContainsVariable() { assertTrue(FeelExpressions.VariableLiteral("x").containsVariable("x")); } | public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpression((__, lower... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... | FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(name)) .RangeExpr... |
@Test public void testWithDefault_usingBothCacertsAndRioKeyStore() throws Exception { AggregateTrustManager.initialize(keyStore); URL locationURL = new URL("https: URLConnection urlConnection = locationURL.openConnection(); urlConnection.connect(); } | public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory... | AggregateTrustManager implements X509TrustManager { public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRand... | AggregateTrustManager implements X509TrustManager { public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRand... | AggregateTrustManager implements X509TrustManager { public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRand... | AggregateTrustManager implements X509TrustManager { public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRand... |
@Test public void testIdleServiceManager() throws InterruptedException { ServiceElement serviceElement = TestUtil.makeServiceElement("bar", "foo", 2); IdleServiceManager idleServiceManager = new IdleServiceManager(3000L, serviceElement); TestServiceActivityProvider sap1 = new TestServiceActivityProvider(); TestServiceA... | public IdleServiceManager(final Long maxIdleTime, final ServiceElement serviceElement) { this.maxIdleTime = maxIdleTime; this.serviceElement = serviceElement; long delay = TimeUtil.computeLeaseRenewalTime(maxIdleTime); if(logger.isDebugEnabled()) { logger.debug("Service [{}] idle time: {}, computed delay time for check... | IdleServiceManager { public IdleServiceManager(final Long maxIdleTime, final ServiceElement serviceElement) { this.maxIdleTime = maxIdleTime; this.serviceElement = serviceElement; long delay = TimeUtil.computeLeaseRenewalTime(maxIdleTime); if(logger.isDebugEnabled()) { logger.debug("Service [{}] idle time: {}, computed... | IdleServiceManager { public IdleServiceManager(final Long maxIdleTime, final ServiceElement serviceElement) { this.maxIdleTime = maxIdleTime; this.serviceElement = serviceElement; long delay = TimeUtil.computeLeaseRenewalTime(maxIdleTime); if(logger.isDebugEnabled()) { logger.debug("Service [{}] idle time: {}, computed... | IdleServiceManager { public IdleServiceManager(final Long maxIdleTime, final ServiceElement serviceElement) { this.maxIdleTime = maxIdleTime; this.serviceElement = serviceElement; long delay = TimeUtil.computeLeaseRenewalTime(maxIdleTime); if(logger.isDebugEnabled()) { logger.debug("Service [{}] idle time: {}, computed... | IdleServiceManager { public IdleServiceManager(final Long maxIdleTime, final ServiceElement serviceElement) { this.maxIdleTime = maxIdleTime; this.serviceElement = serviceElement; long delay = TimeUtil.computeLeaseRenewalTime(maxIdleTime); if(logger.isDebugEnabled()) { logger.debug("Service [{}] idle time: {}, computed... |
@Test public void testSubscribe() { ServiceChannel serviceChannel = ServiceChannel.getInstance(); ServiceElement serviceElement = TestUtil.makeServiceElement("bar", "foo"); Listener l1 = new Listener(); serviceChannel.subscribe(l1, serviceElement, ServiceChannelEvent.Type.PROVISIONED); Listener l2 = new Listener(); ser... | public void subscribe(final ServiceChannelListener listener, final AssociationDescriptor associationDescriptor, final ServiceChannelEvent.Type type) { subscribe(listener, associationDescriptor.getName(), associationDescriptor.getInterfaceNames(), associationDescriptor.getOperationalStringName(), type); } | ServiceChannel { public void subscribe(final ServiceChannelListener listener, final AssociationDescriptor associationDescriptor, final ServiceChannelEvent.Type type) { subscribe(listener, associationDescriptor.getName(), associationDescriptor.getInterfaceNames(), associationDescriptor.getOperationalStringName(), type);... | ServiceChannel { public void subscribe(final ServiceChannelListener listener, final AssociationDescriptor associationDescriptor, final ServiceChannelEvent.Type type) { subscribe(listener, associationDescriptor.getName(), associationDescriptor.getInterfaceNames(), associationDescriptor.getOperationalStringName(), type);... | ServiceChannel { public void subscribe(final ServiceChannelListener listener, final AssociationDescriptor associationDescriptor, final ServiceChannelEvent.Type type) { subscribe(listener, associationDescriptor.getName(), associationDescriptor.getInterfaceNames(), associationDescriptor.getOperationalStringName(), type);... | ServiceChannel { public void subscribe(final ServiceChannelListener listener, final AssociationDescriptor associationDescriptor, final ServiceChannelEvent.Type type) { subscribe(listener, associationDescriptor.getName(), associationDescriptor.getInterfaceNames(), associationDescriptor.getOperationalStringName(), type);... |
@Test public void testMergeRepositories() throws Exception { RemoteRepository[] r1 = new RemoteRepository[]{createRR("http: createRR("http: RemoteRepository[] r2 = new RemoteRepository[]{createRR("http: createRR("http: RemoteRepository[] repositories = deploymentVerifier.mergeRepositories(r1, r2); Assert.assertTrue(rep... | RemoteRepository[] mergeRepositories(final RemoteRepository[] r1, final RemoteRepository[] r2) { Set<RemoteRepository> remoteRepositories = new HashSet<>(); Collections.addAll(remoteRepositories, r1); Collections.addAll(remoteRepositories, r2); return remoteRepositories.toArray(new RemoteRepository[0]); } | DeploymentVerifier { RemoteRepository[] mergeRepositories(final RemoteRepository[] r1, final RemoteRepository[] r2) { Set<RemoteRepository> remoteRepositories = new HashSet<>(); Collections.addAll(remoteRepositories, r1); Collections.addAll(remoteRepositories, r2); return remoteRepositories.toArray(new RemoteRepository... | DeploymentVerifier { RemoteRepository[] mergeRepositories(final RemoteRepository[] r1, final RemoteRepository[] r2) { Set<RemoteRepository> remoteRepositories = new HashSet<>(); Collections.addAll(remoteRepositories, r1); Collections.addAll(remoteRepositories, r2); return remoteRepositories.toArray(new RemoteRepository... | DeploymentVerifier { RemoteRepository[] mergeRepositories(final RemoteRepository[] r1, final RemoteRepository[] r2) { Set<RemoteRepository> remoteRepositories = new HashSet<>(); Collections.addAll(remoteRepositories, r1); Collections.addAll(remoteRepositories, r2); return remoteRepositories.toArray(new RemoteRepository... | DeploymentVerifier { RemoteRepository[] mergeRepositories(final RemoteRepository[] r1, final RemoteRepository[] r2) { Set<RemoteRepository> remoteRepositories = new HashSet<>(); Collections.addAll(remoteRepositories, r1); Collections.addAll(remoteRepositories, r2); return remoteRepositories.toArray(new RemoteRepository... |
@Test public void testEnsureGroups() throws Exception { startLookup("foo"); Assert.assertFalse(hasGroup(registrar, "gack")); ServiceElement service = createSE("gack"); Assert.assertTrue(waitForDiscovery(listener)); Assert.assertTrue(listener.discovered.get()); DL newDiscoListener = new DL(); new LookupDiscoveryManager(... | void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegistrar registrar : disc... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... |
@Test public void testEnsureMultiGroups() throws Exception { startLookup("foo"); Assert.assertTrue(waitForDiscovery(listener)); Assert.assertFalse(hasGroup(registrar, "gack")); Assert.assertFalse(hasGroup(registrar, "blutarsky")); ServiceElement service = createSE("gack", "blutarsky"); Assert.assertTrue(listener.discov... | void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegistrar registrar : disc... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... |
@Test(expected = IOException.class) public void testAllGroupsFail() throws Exception { ServiceElement service = new ServiceElement(); ServiceBeanConfig serviceBeanConfig = new ServiceBeanConfig(); serviceBeanConfig.setGroups("all"); service.setServiceBeanConfig(serviceBeanConfig); deploymentVerifier.ensureGroups(servic... | void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegistrar registrar : disc... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... | DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } for(ServiceRegis... |
@Test public void testTerminate() throws Exception { serviceStatementManager.terminate(); Assert.assertTrue(serviceStatementManager.get().length==0); } | public void terminate() { statementMap.clear(); } | TransientServiceStatementManager implements ServiceStatementManager { public void terminate() { statementMap.clear(); } } | TransientServiceStatementManager implements ServiceStatementManager { public void terminate() { statementMap.clear(); } TransientServiceStatementManager(Configuration config); } | TransientServiceStatementManager implements ServiceStatementManager { public void terminate() { statementMap.clear(); } TransientServiceStatementManager(Configuration config); void terminate(); ServiceStatement[] get(); ServiceStatement get(ServiceElement sElem); void record(ServiceStatement statement); } | TransientServiceStatementManager implements ServiceStatementManager { public void terminate() { statementMap.clear(); } TransientServiceStatementManager(Configuration config); void terminate(); ServiceStatement[] get(); ServiceStatement get(ServiceElement sElem); void record(ServiceStatement statement); } |
@Test public void testGetActiveServiceStatements() throws Exception { ServiceStatement[] statements = serviceStatementManager.get(); List<ServiceRecord> list = new ArrayList<ServiceRecord>(); for (ServiceStatement statement : statements) { ServiceRecord[] records = statement.getServiceRecords(recordingUuid, ServiceReco... | public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } | TransientServiceStatementManager implements ServiceStatementManager { public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } } | TransientServiceStatementManager implements ServiceStatementManager { public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } TransientServiceStatementManager(Con... | TransientServiceStatementManager implements ServiceStatementManager { public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } TransientServiceStatementManager(Con... | TransientServiceStatementManager implements ServiceStatementManager { public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } TransientServiceStatementManager(Con... |
@Test public void testRecordAndRetrieve() throws Exception { Assert.assertEquals(statements.size(), serviceStatementManager.get().length); for(ServiceStatement statement : statements) { ServiceStatement s = serviceStatementManager.get(statement.getServiceElement()); Assert.assertEquals(statement, s); Assert.assertEqual... | public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } | TransientServiceStatementManager implements ServiceStatementManager { public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } } | TransientServiceStatementManager implements ServiceStatementManager { public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } TransientServiceStatementManager(Con... | TransientServiceStatementManager implements ServiceStatementManager { public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } TransientServiceStatementManager(Con... | TransientServiceStatementManager implements ServiceStatementManager { public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } TransientServiceStatementManager(Con... |
@Test public void testGetLocalRepositoryLocation() throws Exception { Settings settings = SettingsUtil.getSettings(); String localRepositoryLocation = SettingsUtil.getLocalRepositoryLocation(settings); Assert.assertNotNull(localRepositoryLocation); } | public static String getLocalRepositoryLocation(final Settings settings) { if(settings==null) throw new IllegalArgumentException("settings must not be null"); String localRepositoryLocation = settings.getLocalRepository(); if (localRepositoryLocation == null) { StringBuilder locationBuilder = new StringBuilder(); locat... | SettingsUtil { public static String getLocalRepositoryLocation(final Settings settings) { if(settings==null) throw new IllegalArgumentException("settings must not be null"); String localRepositoryLocation = settings.getLocalRepository(); if (localRepositoryLocation == null) { StringBuilder locationBuilder = new StringB... | SettingsUtil { public static String getLocalRepositoryLocation(final Settings settings) { if(settings==null) throw new IllegalArgumentException("settings must not be null"); String localRepositoryLocation = settings.getLocalRepository(); if (localRepositoryLocation == null) { StringBuilder locationBuilder = new StringB... | SettingsUtil { public static String getLocalRepositoryLocation(final Settings settings) { if(settings==null) throw new IllegalArgumentException("settings must not be null"); String localRepositoryLocation = settings.getLocalRepository(); if (localRepositoryLocation == null) { StringBuilder locationBuilder = new StringB... | SettingsUtil { public static String getLocalRepositoryLocation(final Settings settings) { if(settings==null) throw new IllegalArgumentException("settings must not be null"); String localRepositoryLocation = settings.getLocalRepository(); if (localRepositoryLocation == null) { StringBuilder locationBuilder = new StringB... |
@Test public void testLocalRepositoryWorkspaceReader() throws SettingsBuildingException { LocalRepositoryWorkspaceReader workspaceReader = new LocalRepositoryWorkspaceReader(); Artifact a = new DefaultArtifact("something.something:darkside-deathstar:pom:2.1"); String path = workspaceReader.getArtifactPath(a); System.ou... | public LocalRepositoryWorkspaceReader() throws SettingsBuildingException { localRepositoryDir = SettingsUtil.getLocalRepositoryLocation(SettingsUtil.getSettings()); } | LocalRepositoryWorkspaceReader implements WorkspaceReader { public LocalRepositoryWorkspaceReader() throws SettingsBuildingException { localRepositoryDir = SettingsUtil.getLocalRepositoryLocation(SettingsUtil.getSettings()); } } | LocalRepositoryWorkspaceReader implements WorkspaceReader { public LocalRepositoryWorkspaceReader() throws SettingsBuildingException { localRepositoryDir = SettingsUtil.getLocalRepositoryLocation(SettingsUtil.getSettings()); } LocalRepositoryWorkspaceReader(); } | LocalRepositoryWorkspaceReader implements WorkspaceReader { public LocalRepositoryWorkspaceReader() throws SettingsBuildingException { localRepositoryDir = SettingsUtil.getLocalRepositoryLocation(SettingsUtil.getSettings()); } LocalRepositoryWorkspaceReader(); WorkspaceRepository getRepository(); File findArtifact(Arti... | LocalRepositoryWorkspaceReader implements WorkspaceReader { public LocalRepositoryWorkspaceReader() throws SettingsBuildingException { localRepositoryDir = SettingsUtil.getLocalRepositoryLocation(SettingsUtil.getSettings()); } LocalRepositoryWorkspaceReader(); WorkspaceRepository getRepository(); File findArtifact(Arti... |
@Test public void testEquality() { ServiceBeanConfig sbc = new ServiceBeanConfig(new HashMap<String, Object>(), new String[]{"-"}); ClassBundle export1 = new ClassBundle("org.rioproject.service.Service"); export1.addJAR("rio-api.jar"); export1.addJAR("service-dl.jar"); export1.setCodebase("http: ClassBundle impl = new ... | public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof ServiceElement)) { return false; } ServiceElement that = (ServiceElement)obj; if (this.getName().equals(that.getName()) && this.getOperationalStringName().equals(that.getOperationalStringName())) { if (this.exportBundles.length != th... | ServiceElement implements Serializable { public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof ServiceElement)) { return false; } ServiceElement that = (ServiceElement)obj; if (this.getName().equals(that.getName()) && this.getOperationalStringName().equals(that.getOperationalStringName(... | ServiceElement implements Serializable { public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof ServiceElement)) { return false; } ServiceElement that = (ServiceElement)obj; if (this.getName().equals(that.getName()) && this.getOperationalStringName().equals(that.getOperationalStringName(... | ServiceElement implements Serializable { public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof ServiceElement)) { return false; } ServiceElement that = (ServiceElement)obj; if (this.getName().equals(that.getName()) && this.getOperationalStringName().equals(that.getOperationalStringName(... | ServiceElement implements Serializable { public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof ServiceElement)) { return false; } ServiceElement that = (ServiceElement)obj; if (this.getName().equals(that.getName()) && this.getOperationalStringName().equals(that.getOperationalStringName(... |
@Test public void testDoesNotSupportHostAddress() throws Exception { SystemComponent requirement = new SystemComponent(TCPConnectivity.ID); requirement.put(TCPConnectivity.HOST_ADDRESS, "127.0.0.1"); TCPConnectivity tcpConnectivity = new TCPConnectivity(); tcpConnectivity.define(TCPConnectivity.HOST_ADDRESS, "10.0.1.1"... | @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (String) requirement.getAttributes().get(HOST_NAME);... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... |
@Test public void testSupportsHostAddress() throws Exception { SystemComponent requirement = new SystemComponent(TCPConnectivity.ID); requirement.put(TCPConnectivity.HOST_ADDRESS, "127.0.0.1"); TCPConnectivity tcpConnectivity = new TCPConnectivity(); tcpConnectivity.define(TCPConnectivity.HOST_ADDRESS, "127.0.0.1"); As... | @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (String) requirement.getAttributes().get(HOST_NAME);... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... |
@Test public void testSupportsHostName() throws Exception { SystemComponent requirement = new SystemComponent(TCPConnectivity.ID); requirement.put(TCPConnectivity.HOST_NAME, "mixed.case.name.net"); TCPConnectivity tcpConnectivity = new TCPConnectivity(); tcpConnectivity.define(TCPConnectivity.HOST_NAME, "MiXed.Case.Nam... | @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (String) requirement.getAttributes().get(HOST_NAME);... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... |
@Test public void testDoesNotSupportHostName() throws Exception { SystemComponent requirement = new SystemComponent(TCPConnectivity.ID); requirement.put(TCPConnectivity.HOST_NAME, "some.name.net"); TCPConnectivity tcpConnectivity = new TCPConnectivity(); tcpConnectivity.define(TCPConnectivity.HOST_NAME, "some.other.nam... | @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (String) requirement.getAttributes().get(HOST_NAME);... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... | TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String hostName = (St... |
@Test public void testGetDownloadSize() throws IOException { StagedData stagedData = new StagedData(); stagedData.setLocation("https: long size = stagedData.getDownloadSize(); assertTrue(size != -1); } | public long getDownloadSize() throws IOException { getLocationURL(); return locationURL.openConnection().getContentLengthLong(); } | StagedData implements Serializable { public long getDownloadSize() throws IOException { getLocationURL(); return locationURL.openConnection().getContentLengthLong(); } } | StagedData implements Serializable { public long getDownloadSize() throws IOException { getLocationURL(); return locationURL.openConnection().getContentLengthLong(); } } | StagedData implements Serializable { public long getDownloadSize() throws IOException { getLocationURL(); return locationURL.openConnection().getContentLengthLong(); } long getDownloadSize(); URL getLocationURL(); String getLocation(); void setLocation(String location); String getInstallRoot(); void setInstallRoot(Str... | StagedData implements Serializable { public long getDownloadSize() throws IOException { getLocationURL(); return locationURL.openConnection().getContentLengthLong(); } long getDownloadSize(); URL getLocationURL(); String getLocation(); void setLocation(String location); String getInstallRoot(); void setInstallRoot(Str... |
@Test public void testGetOrganization() { ServiceElement element = makeServiceElement("Foo"); Uuid uuid = UuidFactory.generate(); ServiceRecord record = new ServiceRecord(uuid, element, "hostname"); ServiceStatement statement = new ServiceStatement(element); statement.putServiceRecord(recordingUuid, record); String org... | public String getOrganization() { String organization = sElem.getServiceBeanConfig().getOrganization(); organization = (organization==null ? "" : organization); return (organization); } | ServiceStatement implements Serializable { public String getOrganization() { String organization = sElem.getServiceBeanConfig().getOrganization(); organization = (organization==null ? "" : organization); return (organization); } } | ServiceStatement implements Serializable { public String getOrganization() { String organization = sElem.getServiceBeanConfig().getOrganization(); organization = (organization==null ? "" : organization); return (organization); } ServiceStatement(final ServiceElement sElem); } | ServiceStatement implements Serializable { public String getOrganization() { String organization = sElem.getServiceBeanConfig().getOrganization(); organization = (organization==null ? "" : organization); return (organization); } ServiceStatement(final ServiceElement sElem); ServiceElement getServiceElement(); String ge... | ServiceStatement implements Serializable { public String getOrganization() { String organization = sElem.getServiceBeanConfig().getOrganization(); organization = (organization==null ? "" : organization); return (organization); } ServiceStatement(final ServiceElement sElem); ServiceElement getServiceElement(); String ge... |
@Test public void testGetPlatformMBeanAgentID() throws Exception { String agentID = JMXConnectionUtil.getPlatformMBeanServerAgentId(); Assert.assertNotNull(agentID); } | public static String getPlatformMBeanServerAgentId() throws Exception { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); final String SERVER_DELEGATE = "JMImplementation:type=MBeanServerDelegate"; final String MBEAN_SERVER_ID_KEY = "MBeanServerId"; ObjectName delegateObjName = new ObjectName(SERVER_DELEGAT... | JMXConnectionUtil { public static String getPlatformMBeanServerAgentId() throws Exception { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); final String SERVER_DELEGATE = "JMImplementation:type=MBeanServerDelegate"; final String MBEAN_SERVER_ID_KEY = "MBeanServerId"; ObjectName delegateObjName = new Objec... | JMXConnectionUtil { public static String getPlatformMBeanServerAgentId() throws Exception { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); final String SERVER_DELEGATE = "JMImplementation:type=MBeanServerDelegate"; final String MBEAN_SERVER_ID_KEY = "MBeanServerId"; ObjectName delegateObjName = new Objec... | JMXConnectionUtil { public static String getPlatformMBeanServerAgentId() throws Exception { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); final String SERVER_DELEGATE = "JMImplementation:type=MBeanServerDelegate"; final String MBEAN_SERVER_ID_KEY = "MBeanServerId"; ObjectName delegateObjName = new Objec... | JMXConnectionUtil { public static String getPlatformMBeanServerAgentId() throws Exception { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); final String SERVER_DELEGATE = "JMImplementation:type=MBeanServerDelegate"; final String MBEAN_SERVER_ID_KEY = "MBeanServerId"; ObjectName delegateObjName = new Objec... |
@Test(expected= SSLHandshakeException.class) public void testWithJustRioKeystore_shouldFail() throws Exception { System.setProperty("javax.net.ssl.trustStore", keyStoreFile.getPath()); AggregateTrustManager.initialize(keyStore); URL locationURL = new URL("https: URLConnection urlConnection = locationURL.openConnection(... | public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory... | AggregateTrustManager implements X509TrustManager { public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRand... | AggregateTrustManager implements X509TrustManager { public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRand... | AggregateTrustManager implements X509TrustManager { public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRand... | AggregateTrustManager implements X509TrustManager { public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRand... |
@Test public void testOpStringLoader() throws Exception { OpStringLoader opStringLoader = new OpStringLoader(); opStringLoader.setDefaultGroups("banjo"); String baseDir = System.getProperty("user.dir"); File calculator = new File(baseDir, "src/test/resources/opstrings/opstringloadertest.groovy"); OperationalString[] op... | public OpStringLoader() { this(null); } | OpStringLoader { public OpStringLoader() { this(null); } } | OpStringLoader { public OpStringLoader() { this(null); } OpStringLoader(); OpStringLoader(ClassLoader loader); } | OpStringLoader { public OpStringLoader() { this(null); } OpStringLoader(); OpStringLoader(ClassLoader loader); void setDefaultGroups(String... groups); OperationalString[] parseOperationalString(File file); OperationalString[] parseOperationalString(URL url); } | OpStringLoader { public OpStringLoader() { this(null); } OpStringLoader(); OpStringLoader(ClassLoader loader); void setDefaultGroups(String... groups); OperationalString[] parseOperationalString(File file); OperationalString[] parseOperationalString(URL url); static final String DEFAULT_FDH; } |
@Test public void testSetElapsedTime1() throws RemoteException { StopWatch watch = new StopWatch("watch"); List<Long> expected = new ArrayList<Long>(); checkData(expected, watch); for (int i = 0; i < 10; i++) { long value = Math.round(Math.random() * 100); watch.setElapsedTime(value); expected.add(value); checkData(exp... | public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String id); } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String id); void start... | StopWatch extends ThresholdWatch implements StopWatchMBean { public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String id); void start... |
@Test public void testSetElapsedTime2() throws RemoteException { StopWatch watch = new StopWatch("watch"); List<Long> expectedValues = new ArrayList<Long>(); List<Long> expectedStamps = new ArrayList<Long>(); checkData(expectedValues, expectedStamps, watch); for (int i = 0; i < 10; i++) { long value = Math.round(Math.r... | public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String id); } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String id); void start... | StopWatch extends ThresholdWatch implements StopWatchMBean { public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String id); void start... |
@Test public void testStartTiming() throws RemoteException { StopWatch watch = new StopWatch("watch"); Assert.assertEquals(0, watch.getStartTime()); long prevStartTime = -1; for (int i = 0; i < 10; i++) { Utils.sleep(100); watch.startTiming(); long startTime = watch.getStartTime(); Assert.assertTrue(startTime >= 0); if... | public void startTiming() { setStartTime(System.currentTimeMillis()); } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void startTiming() { setStartTime(System.currentTimeMillis()); } } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void startTiming() { setStartTime(System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String id); } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void startTiming() { setStartTime(System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String id); void startTiming(); void stopTiming(... | StopWatch extends ThresholdWatch implements StopWatchMBean { public void startTiming() { setStartTime(System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String id); void startTiming(); void stopTiming(... |
@Test public void testStopTiming() throws RemoteException { StopWatch watch = new StopWatch("watch"); DataSourceMonitor mon = new DataSourceMonitor(watch); checkData(0, watch); for (int i = 0; i < 10; i++) { Utils.sleep(100); watch.stopTiming(); mon.waitFor(i + 1); Calculable[] calcs = watch.getWatchDataSource().getCal... | public void stopTiming() { long now = System.currentTimeMillis(); long startTime = getStartTime(); long elapsed = now - startTime; setElapsedTime(elapsed, now); } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void stopTiming() { long now = System.currentTimeMillis(); long startTime = getStartTime(); long elapsed = now - startTime; setElapsedTime(elapsed, now); } } | StopWatch extends ThresholdWatch implements StopWatchMBean { public void stopTiming() { long now = System.currentTimeMillis(); long startTime = getStartTime(); long elapsed = now - startTime; setElapsedTime(elapsed, now); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") ... | StopWatch extends ThresholdWatch implements StopWatchMBean { public void stopTiming() { long now = System.currentTimeMillis(); long startTime = getStartTime(); long elapsed = now - startTime; setElapsedTime(elapsed, now); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") ... | StopWatch extends ThresholdWatch implements StopWatchMBean { public void stopTiming() { long now = System.currentTimeMillis(); long startTime = getStartTime(); long elapsed = now - startTime; setElapsedTime(elapsed, now); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") ... |
@Test public void testThresholdCrossedAscending() throws Exception { BoundedThresholdManager thresholdManager = new BoundedThresholdManager("foo"); ThresholdValues thresholdValues = new ThresholdValues(0, 5); thresholdManager.setThresholdValues(thresholdValues); MyThresholdListener listener = new MyThresholdListener();... | public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed = false; direction = CLEARED; thresholdValues.incTh... | BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ... | BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ... | BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ... | BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.