congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ArrayOverrideStrategyResolver.resolve
Code IndexAdd Tabnine to your IDE (free)

How to use
resolve
method
in
org.kaaproject.kaa.server.common.core.algorithms.override.ArrayOverrideStrategyResolver

Best Java code snippets using org.kaaproject.kaa.server.common.core.algorithms.override.ArrayOverrideStrategyResolver.resolve (Showing top 4 results out of 315)

origin: kaaproject/kaa

@Test(expected = OverrideException.class)
public void testResolveFailsWhenSchemaForParentIsNotFound() throws Exception {
 Path schemaUrl = Paths.get(Thread.currentThread().getContextClassLoader().getResource("override/schema.json").toURI());
 DataSchema configurationSchema = new DataSchema(new String(Files.readAllBytes(schemaUrl)));
 SchemaGenerationAlgorithmFactory factory = new SchemaGenerationAlgorithmFactoryImpl();
 SchemaGenerationAlgorithm generator = factory.createSchemaGenerator(configurationSchema);
 KaaSchema baseSchemaString = generator.getBaseSchema();
 Schema.Parser baseParser = new Schema.Parser();
 baseParser.parse(baseSchemaString.getRawSchema());
 ArrayOverrideStrategyResolver arrayMergeStrategyResolver = new ArrayOverrideStrategyResolver(baseParser.getTypes());
 arrayMergeStrategyResolver.resolve("wrong_parent_name", "org.kaa.config", "child_name");
}
origin: kaaproject/kaa

@Test
public void testStrategyIsResolvedToOverrideWhenFieldsDefinitionIsEmpty() throws Exception {
 Path schemaUrl = Paths.get(Thread.currentThread().getContextClassLoader().getResource("override/schema_for_array_merge_strategy_resolver_with_empty_fields_definition.json").toURI());
 DataSchema configurationSchema = new DataSchema(new String(Files.readAllBytes(schemaUrl)));
 SchemaGenerationAlgorithmFactory factory = new SchemaGenerationAlgorithmFactoryImpl();
 SchemaGenerationAlgorithm generator = factory.createSchemaGenerator(configurationSchema);
 KaaSchema baseSchemaString = generator.getBaseSchema();
 Schema.Parser baseParser = new Schema.Parser();
 baseParser.parse(baseSchemaString.getRawSchema());
 ArrayOverrideStrategyResolver arrayMergeStrategyResolver = new ArrayOverrideStrategyResolver(baseParser.getTypes());
 ArrayOverrideStrategy actualArrayMergeStrategy = arrayMergeStrategyResolver.resolve("testT", "org.kaa.config", "child_name");
 Assert.assertTrue(ArrayOverrideStrategy.REPLACE == actualArrayMergeStrategy);
}
origin: kaaproject/kaa

 @Test
 public void testResolveSuccessForUnionWithArrayType() throws Exception {
  Path schemaUrl = Paths.get(Thread.currentThread().getContextClassLoader().getResource("override/schema_for_array_merge_strategy_resolver_with_array_in_union_type.json").toURI());
  DataSchema configurationSchema = new DataSchema(new String(Files.readAllBytes(schemaUrl)));

  SchemaGenerationAlgorithmFactory factory = new SchemaGenerationAlgorithmFactoryImpl();
  SchemaGenerationAlgorithm generator = factory.createSchemaGenerator(configurationSchema);

  KaaSchema baseSchemaString = generator.getBaseSchema();

  Schema.Parser baseParser = new Schema.Parser();
  baseParser.parse(baseSchemaString.getRawSchema());

  ArrayOverrideStrategyResolver arrayMergeStrategyResolver = new ArrayOverrideStrategyResolver(baseParser.getTypes());
  ArrayOverrideStrategy actualArrayMergeStrategy = arrayMergeStrategyResolver.resolve("testT", "org.kaa.config", "field1");
  Assert.assertTrue(ArrayOverrideStrategy.APPEND == actualArrayMergeStrategy);
 }
}
origin: kaaproject/kaa

mergeStrategy = arrayMergeStrategyResolver.resolve(
    sourceRootSchema.getName(), sourceRootSchema.getNamespace(), sourceChildname);
org.kaaproject.kaa.server.common.core.algorithms.overrideArrayOverrideStrategyResolverresolve

Javadoc

Resolve.

Popular methods of ArrayOverrideStrategyResolver

  • <init>
    Instantiates a new array merge strategy resolver.
  • findMergeStrategy
    Find merge strategy.

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JFileChooser (javax.swing)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now