Search in sources :

Example 1 with BindingsTemplate

use of io.nosqlbench.virtdata.core.bindings.BindingsTemplate in project nosqlbench by nosqlbench.

the class VirtDataTest method testBasicBindings.

@Test
public void testBasicBindings() {
    BindingsTemplate bt = VirtData.getTemplate("a", "Mod(5)");
    assertThat(bt).isNotNull();
}
Also used : BindingsTemplate(io.nosqlbench.virtdata.core.bindings.BindingsTemplate) Test(org.junit.jupiter.api.Test)

Example 2 with BindingsTemplate

use of io.nosqlbench.virtdata.core.bindings.BindingsTemplate in project nosqlbench by nosqlbench.

the class IntegratedComposerLibraryTest method testChainedTypeResolutionForWithInternalLong.

@Test
public void testChainedTypeResolutionForWithInternalLong() {
    BindingsTemplate bt = new BindingsTemplate();
    bt.addFieldBinding("longchain", "compose HashRange(1234,6789) -> long; Mod(3) -> int;");
    Bindings bindings = bt.resolveBindings();
    Object n1 = bindings.getAll(123)[0];
    assertThat(n1).isOfAnyClassIn(Integer.class);
}
Also used : Bindings(io.nosqlbench.virtdata.core.bindings.Bindings) BindingsTemplate(io.nosqlbench.virtdata.core.bindings.BindingsTemplate) Test(org.junit.jupiter.api.Test)

Example 3 with BindingsTemplate

use of io.nosqlbench.virtdata.core.bindings.BindingsTemplate in project nosqlbench by nosqlbench.

the class IntegratedComposerLibraryTest method testStringConversion.

@Test
public void testStringConversion() {
    BindingsTemplate bt = new BindingsTemplate();
    bt.addFieldBinding("phone", "compose HashRange(1000000000,9999999999L); ToString() -> String");
    Bindings bindings = bt.resolveBindings();
}
Also used : Bindings(io.nosqlbench.virtdata.core.bindings.Bindings) BindingsTemplate(io.nosqlbench.virtdata.core.bindings.BindingsTemplate) Test(org.junit.jupiter.api.Test)

Example 4 with BindingsTemplate

use of io.nosqlbench.virtdata.core.bindings.BindingsTemplate in project nosqlbench by nosqlbench.

the class IntegratedComposerLibraryTest method testPrefixSuffix.

@Test
public void testPrefixSuffix() {
    BindingsTemplate bt = new BindingsTemplate();
    bt.addFieldBinding("solr_query", "compose HashRange(1000000000,9999999999L); ToString(); Prefix('before'); Suffix('after') -> String");
    Bindings bindings = bt.resolveBindings();
}
Also used : Bindings(io.nosqlbench.virtdata.core.bindings.Bindings) BindingsTemplate(io.nosqlbench.virtdata.core.bindings.BindingsTemplate) Test(org.junit.jupiter.api.Test)

Example 5 with BindingsTemplate

use of io.nosqlbench.virtdata.core.bindings.BindingsTemplate in project nosqlbench by nosqlbench.

the class IntegratedComposerLibraryTest method testChainedTypeResolutionForInt.

@Test
public void testChainedTypeResolutionForInt() {
    BindingsTemplate bt = new BindingsTemplate();
    bt.addFieldBinding("intchain", "compose ToInt() ; CycleRange(123456789) ; Div(3) ; Mod(7) -> int");
    Bindings bindings = bt.resolveBindings();
}
Also used : Bindings(io.nosqlbench.virtdata.core.bindings.Bindings) BindingsTemplate(io.nosqlbench.virtdata.core.bindings.BindingsTemplate) Test(org.junit.jupiter.api.Test)

Aggregations

BindingsTemplate (io.nosqlbench.virtdata.core.bindings.BindingsTemplate)13 Test (org.junit.jupiter.api.Test)10 Bindings (io.nosqlbench.virtdata.core.bindings.Bindings)8 ParsedTemplate (io.nosqlbench.virtdata.core.templates.ParsedTemplate)2 Disabled (org.junit.jupiter.api.Disabled)2 Histogram (com.codahale.metrics.Histogram)1 Timer (com.codahale.metrics.Timer)1 Binding (groovy.lang.Binding)1 GroovyShell (groovy.lang.GroovyShell)1 Script (groovy.lang.Script)1 Cqld4FluentGraphOpDispenser (io.nosqlbench.adapter.cqld4.opdispensers.Cqld4FluentGraphOpDispenser)1 TemplateFormat (io.nosqlbench.adapters.stdout.TemplateFormat)1 ActivityDefObserver (io.nosqlbench.engine.api.activityapi.core.ActivityDefObserver)1 OpSequence (io.nosqlbench.engine.api.activityapi.planning.OpSequence)1 SequencePlanner (io.nosqlbench.engine.api.activityapi.planning.SequencePlanner)1 SequencerType (io.nosqlbench.engine.api.activityapi.planning.SequencerType)1 StatementsLoader (io.nosqlbench.engine.api.activityconfig.StatementsLoader)1 OpTemplate (io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate)1 StmtsDocList (io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList)1 ActivityDef (io.nosqlbench.engine.api.activityimpl.ActivityDef)1