Package org.teiid.deployers

Examples of org.teiid.deployers.ExtendedPropertyMetadata


  private static ManagedProperty createConnectorProperty(ConfigPropertyMetaData metadata) {
   
    DescriptionMetaData descMetadata = metadata.getDescription();
    String description = descMetadata.getDescription();
    if (description != null) {
      ExtendedPropertyMetadata extended = new ExtendedPropertyMetadata(metadata.getName(), metadata.getType(), description, metadata.getValue());
      return ManagedPropertyUtil.convert(extended);
    }
   
    DefaultFieldsImpl fields = new DefaultFieldsImpl(metadata.getName());
    SimpleMetaType metaType = SimpleMetaType.resolve(metadata.getType());
View Full Code Here


@SuppressWarnings("nls")
public class TestExtendedPropertyMetadata {

  @Test
  public void testDefault() {
    ExtendedPropertyMetadata metadata = new ExtendedPropertyMetadata("x", "java.lang.String", "some-name", null);
   
    Assert.assertEquals("some-name", metadata.display());
    Assert.assertEquals(null, metadata.description());
    Assert.assertEquals(false, metadata.advanced());
    Assert.assertEquals(false, metadata.required());
    Assert.assertEquals(false, metadata.masked());
    Assert.assertEquals(true , metadata.readOnly());
  }
View Full Code Here

  public void testFormatted() {
    ArrayList<String> allowed =  new ArrayList<String>();
    allowed.add("get");
    allowed.add("post");
   
    ExtendedPropertyMetadata metadata = new ExtendedPropertyMetadata("x", "java.lang.String", "{$display:\"Is Immutable\",$description:\"True if the source never changes.\",$allowed:[\"get\",\"post\"], $required:\"true\",$advanced:\"true\"}", null);
   
    Assert.assertEquals("Is Immutable", metadata.display());
    Assert.assertEquals("True if the source never changes.", metadata.description());
    Assert.assertEquals(true, metadata.advanced());
    Assert.assertEquals(true, metadata.required());
    Assert.assertEquals(false, metadata.masked());
    Assert.assertEquals(true , metadata.readOnly());   
    Assert.assertEquals(allowed , Arrays.asList(metadata.allowed()));
  }
View Full Code Here

  public void testFormattedExtraCommasAndColons() {
    ArrayList<String> allowed =  new ArrayList<String>();
    allowed.add("get");
    allowed.add("post");
   
    ExtendedPropertyMetadata metadata = new ExtendedPropertyMetadata("x", "java.lang.String","{$display:\"Is Immu:table\",$description:\"True if the, source never changes.\",$allowed:[\"get\",\"post\"], $required:\"true\",$advanced:\"true\"}", null);
   
    Assert.assertEquals("Is Immu:table", metadata.display());
    Assert.assertEquals("True if the, source never changes.", metadata.description());
    Assert.assertEquals(true, metadata.advanced());
    Assert.assertEquals(true, metadata.required());
    Assert.assertEquals(false, metadata.masked());
    Assert.assertEquals(true , metadata.readOnly());   
    Assert.assertEquals(allowed , Arrays.asList(metadata.allowed()));
 
View Full Code Here

  public void testBlankProperties() {
    ArrayList<String> allowed =  new ArrayList<String>();
    allowed.add("get");
    allowed.add("post");
   
    ExtendedPropertyMetadata metadata = new ExtendedPropertyMetadata("x", "java.lang.String","{$display:\"Is Immutable\",$description:\"\",$allowed:[\"get\",\"post\"], $required:\"true\",$advanced:\"true\"}", null);
   
    Assert.assertEquals("Is Immutable", metadata.display());
    Assert.assertEquals("", metadata.description());
    Assert.assertEquals(true, metadata.advanced());
    Assert.assertEquals(true, metadata.required());
    Assert.assertEquals(false, metadata.masked());
    Assert.assertEquals(true , metadata.readOnly());   
    Assert.assertEquals(allowed , Arrays.asList(metadata.allowed()));
 
View Full Code Here

TOP

Related Classes of org.teiid.deployers.ExtendedPropertyMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.