Author: rareddy
Date: 2010-04-09 17:22:55 -0400 (Fri, 09 Apr 2010)
New Revision: 2045
Modified:
trunk/jboss-integration/src/main/java/org/teiid/templates/connector/ExtendedPropertyMetadata.java
trunk/jboss-integration/src/test/java/org/teiid/templates/connector/TestExtendedPropertyMetadata.java
Log:
TEIID-861: allowing support for blank properties
Modified:
trunk/jboss-integration/src/main/java/org/teiid/templates/connector/ExtendedPropertyMetadata.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/templates/connector/ExtendedPropertyMetadata.java 2010-04-09
19:44:15 UTC (rev 2044)
+++
trunk/jboss-integration/src/main/java/org/teiid/templates/connector/ExtendedPropertyMetadata.java 2010-04-09
21:22:55 UTC (rev 2045)
@@ -70,6 +70,9 @@
if (inQuotesStart+1 != index) {
values.add(encodedData.substring(inQuotesStart+1, index));
}
+ else {
+ values.add("");
+ }
inQuotesStart = -1;
}
}
Modified:
trunk/jboss-integration/src/test/java/org/teiid/templates/connector/TestExtendedPropertyMetadata.java
===================================================================
---
trunk/jboss-integration/src/test/java/org/teiid/templates/connector/TestExtendedPropertyMetadata.java 2010-04-09
19:44:15 UTC (rev 2044)
+++
trunk/jboss-integration/src/test/java/org/teiid/templates/connector/TestExtendedPropertyMetadata.java 2010-04-09
21:22:55 UTC (rev 2045)
@@ -74,4 +74,21 @@
Assert.assertEquals(true , metadata.isEditable());
Assert.assertEquals(allowed , metadata.getAllowed());
}
+
+ @Test
+ public void testBlankProperties() {
+ ArrayList<String> allowed = new ArrayList<String>();
+ allowed.add("get");
+ allowed.add("post");
+
+ ExtendedPropertyMetadata metadata = new
ExtendedPropertyMetadata("{$display:\"Is
Immutable\",$description:\"\",$allowed:[\"get\",\"post\"],
$required:\"true\",$advanced:\"true\"}");
+
+ Assert.assertEquals("Is Immutable", metadata.getDisplayName());
+ Assert.assertEquals("", metadata.getDescription());
+ Assert.assertEquals(true, metadata.isAdvanced());
+ Assert.assertEquals(true, metadata.isRequired());
+ Assert.assertEquals(false, metadata.isMasked());
+ Assert.assertEquals(true , metadata.isEditable());
+ Assert.assertEquals(allowed , metadata.getAllowed());
+ }
}
Show replies by date