if (encodedDataType.length() != 1)
@Test public void shouldSetAppropriateDefaultsWhenNoneSpecified() throws Exception { final String testXmlString = "<types>" + " <type name=\"testType\" primitiveType=\"char\"/>" + "</types>"; final Map<String, Type> map = parseTestXmlWithMap("/types/type", testXmlString); // assert that testType is in map and name of Type is correct assertThat(map.get("testType").name(), is("testType")); // assert defaults for length, variableLength and presence final Type t = map.get("testType"); assertThat(t.presence(), is(Presence.REQUIRED)); final EncodedDataType d = (EncodedDataType)t; assertThat(d.length(), is(1)); assertThat(d.isVariableLength(), is(false)); }
@Test public void shouldHandleSettingAllAttributes() throws Exception { final String testXmlString = "<types>" + " <type name=\"testType\" presence=\"required\" primitiveType=\"char\" length=\"1\" " + "variableLength=\"false\"/>" + "</types>"; final Map<String, Type> map = parseTestXmlWithMap("/types/type", testXmlString); // assert that testType is in map and name of Type is correct final Type t = map.get("testType"); assertThat(t.name(), is("testType")); assertThat(t.presence(), is(Presence.REQUIRED)); final EncodedDataType d = (EncodedDataType)t; assertThat(d.primitiveType(), is(PrimitiveType.CHAR)); assertThat(d.length(), is(1)); assertThat(d.isVariableLength(), is(false)); }
if (encodedDataType.length() != 1)
if (encodedDataType.length() != 1)
if (encodedDataType.length() != 1)