Tabnine Logo
Instance.setComponent
Code IndexAdd Tabnine to your IDE (free)

How to use
setComponent
method
in
net.roboconf.core.model.beans.Instance

Best Java code snippets using net.roboconf.core.model.beans.Instance.setComponent (Showing top 7 results out of 315)

origin: net.roboconf/roboconf-dm-rest-commons

instance.setComponent( instanceComponent );
origin: roboconf/roboconf-platform

instance.channels.addAll( ModelUtils.getPropertyValues( currentBlock, ParsingConstants.PROPERTY_INSTANCE_CHANNELS ));
instance.setComponent( ComponentHelpers.findComponent( this.graphs, currentBlock.getName()));
if( instance.getComponent() == null ) {
  ParsingError error = new ParsingError( ErrorCode.CO_INEXISTING_COMPONENT, block.getDeclaringFile().getEditedFile(), currentBlock.getLine());
origin: roboconf/roboconf-platform

@Test
public void testInstance() {
  Instance inst = new Instance();
  Iterator<ModelError> iterator = RuntimeModelValidator.validate( inst ).iterator();
  Assert.assertEquals( ErrorCode.RM_EMPTY_INSTANCE_NAME, iterator.next().getErrorCode());
  Assert.assertEquals( ErrorCode.RM_EMPTY_INSTANCE_COMPONENT, iterator.next().getErrorCode());
  Assert.assertFalse( iterator.hasNext());
  inst.setName( "?my instance?" );
  iterator = RuntimeModelValidator.validate( inst ).iterator();
  Assert.assertEquals( ErrorCode.RM_INVALID_INSTANCE_NAME, iterator.next().getErrorCode());
  Assert.assertEquals( ErrorCode.RM_EMPTY_INSTANCE_COMPONENT, iterator.next().getErrorCode());
  Assert.assertFalse( iterator.hasNext());
  inst.setName( "my-instance" );
  iterator = RuntimeModelValidator.validate( inst ).iterator();
  Assert.assertEquals( ErrorCode.RM_EMPTY_INSTANCE_COMPONENT, iterator.next().getErrorCode());
  Assert.assertFalse( iterator.hasNext());
  inst.setComponent( new Component( "comp" ));
  Assert.assertEquals( 0, RuntimeModelValidator.validate( inst ).size());
  inst.setName( "my instance" );
  Assert.assertEquals( 0, RuntimeModelValidator.validate( inst ).size());
  inst.overriddenExports.put( "inst.value", "whatever" );
  iterator = RuntimeModelValidator.validate( inst ).iterator();
  Assert.assertEquals( ErrorCode.RM_MAGIC_INSTANCE_VARIABLE, iterator.next().getErrorCode());
  Assert.assertFalse( iterator.hasNext());
}
origin: roboconf/roboconf-platform

@Test
public void testFindAllExportedVariables() {
  Instance instance = new Instance( "inst 1" ).component( new Component( "c" ));
  Assert.assertEquals( 0, InstanceHelpers.findAllExportedVariables( instance ).size());
  instance.overriddenExports.put( "var1", "value1" );
  Map<String,String> map = InstanceHelpers.findAllExportedVariables( instance );
  Assert.assertEquals( 1, map.size());
  Assert.assertEquals( "value1", map.get( "var1" ));
  Component component = new Component( "comp 1" );
  component.addExportedVariable( new ExportedVariable( "var1", "another value" ));
  component.addExportedVariable( new ExportedVariable( "var2", "value2" ));
  instance.setComponent( component );
  map = InstanceHelpers.findAllExportedVariables( instance );
  Assert.assertEquals( 2, map.size());
  Assert.assertEquals( "value1", map.get( "comp 1.var1" ));
  Assert.assertEquals( "value2", map.get( "comp 1.var2" ));
  instance.overriddenExports.clear();
  map = InstanceHelpers.findAllExportedVariables( instance );
  Assert.assertEquals( 2, map.size());
  Assert.assertEquals( "another value", map.get( "comp 1.var1" ));
  Assert.assertEquals( "value2", map.get( "comp 1.var2" ));
}
origin: roboconf/roboconf-platform

inst.setComponent( comp );
iterator = RuntimeModelValidator.validate( inst ).iterator();
Assert.assertEquals( ErrorCode.RM_MISSING_VARIABLE_VALUE, iterator.next().getErrorCode());
origin: roboconf/roboconf-platform

instance.setComponent( component );
instance.overriddenExports.put( "var1", "some value" );
instance.overriddenExports.put( "toto.ip", null );
origin: roboconf/roboconf-platform

@Test
public void testIsTarget() {
  Instance inst = new Instance( "i" );
  Assert.assertFalse( InstanceHelpers.isTarget( inst ));
  inst.setComponent( new Component( "comp" ).installerName( "whatever" ));
  Assert.assertFalse( InstanceHelpers.isTarget( inst ));
  inst.getComponent().setInstallerName( Constants.TARGET_INSTALLER );
  Assert.assertTrue( InstanceHelpers.isTarget( inst ));
}
net.roboconf.core.model.beansInstancesetComponent

Popular methods of Instance

  • getName
  • getComponent
  • getStatus
  • <init>
  • getImports
  • setStatus
  • component
  • getParent
  • getChildren
  • setName
  • channel
    Adds a channel in a chain approach.
  • name
    Sets the name in a chain approach.
  • channel,
  • name,
  • setParent,
  • status,
  • equals,
  • parent,
  • toString

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Kernel (java.awt.image)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JTextField (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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