Add Apache JEXL as a dependency, as part of an exploration of on-the-fly contract specialisation (this solution may not be taken forward but suffices to unblock other work)

This commit is contained in:
Mike Hearn 2016-02-29 18:56:03 +01:00
parent 0064f7c254
commit 105f9e1069
3 changed files with 33 additions and 1 deletions

View File

@ -91,6 +91,11 @@ dependencies {
compile("com.intellij:forms_rt:7.0.3") {
exclude group: "asm"
}
// Force commons logging to version 1.2 to override Artemis, which pulls in 1.1.3 (ARTEMIS-424)
compile("commons-logging:commons-logging:1.2") {
force = true
}
}
// These lines tell Gradle to add a couple of JVM command line arguments to unit test and program runs, which set up

View File

@ -42,5 +42,9 @@ dependencies {
compile "io.reactivex:rxkotlin:0.40.1"
// Quasar: for the bytecode rewriting for state machines.
compile("co.paralleluniverse:quasar-core:${quasar_version}:jdk8")
compile "co.paralleluniverse:quasar-core:${quasar_version}:jdk8"
// Apache JEXL: An embeddable expression evaluation library.
// This may be temporary until we experiment with other ways to do on-the-fly contract specialisation via an API.
compile "org.apache.commons:commons-jexl3:3.0"
}

View File

@ -0,0 +1,23 @@
/*
* Copyright 2015 Distributed Ledger Group LLC. Distributed as Licensed Company IP to DLG Group Members
* pursuant to the August 7, 2015 Advisory Services Agreement and subject to the Company IP License terms
* set forth therein.
*
* All other rights reserved.
*/
package core.utilities
import org.apache.commons.jexl3.JexlBuilder
import org.apache.commons.jexl3.MapContext
import org.junit.Test
import kotlin.test.assertEquals
class EmbeddedExpressionsTest {
@Test
fun basic() {
val jexl = JexlBuilder().create()
val result = jexl.createExpression("2 + 2").evaluate(MapContext())
assertEquals(4, result)
}
}