@Test public void isPrivateFieldExists_A$String$String$String_StringIsNull() throws Exception { MethodMetaExtractor target = new MethodMetaExtractor(config); String fieldType = null; String fieldName = null; String sourceCodeString = null; try { target.isPrivateFieldExists(fieldType, fieldName, sourceCodeString); fail(); } catch (JUnitHelperCoreException e) { } }
boolean isPrivateFieldExists(String fieldType, String fieldName, String sourceCodeString) { Assertion.on("fieldType").mustNotBeEmpty(fieldType); Assertion.on("fieldName").mustNotBeEmpty(fieldName); Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); String regExpForFieldNameArea = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1); String regExpForFieldTypeArea = fieldType.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll(",", "\\\\s*,\\\\s*"); String regExpForPrivateFieldThatHasAccessors = ".*?private\\s+" + regExpForFieldTypeArea + "(" + RegExp.Generics + ")*" + RegExp.WhiteSpace.Consecutive_OneOrMore_Max + regExpForFieldNameArea + ".+"; return sourceCodeString.replaceAll(RegExp.CRLF, StringValue.Empty).matches( regExpForPrivateFieldThatHasAccessors); }
MethodMetaExtractor { boolean isPrivateFieldExists(String fieldType, String fieldName, String sourceCodeString) { Assertion.on("fieldType").mustNotBeEmpty(fieldType); Assertion.on("fieldName").mustNotBeEmpty(fieldName); Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); String regExpForFieldNameArea = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1); String regExpForFieldTypeArea = fieldType.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll(",", "\\\\s*,\\\\s*"); String regExpForPrivateFieldThatHasAccessors = ".*?private\\s+" + regExpForFieldTypeArea + "(" + RegExp.Generics + ")*" + RegExp.WhiteSpace.Consecutive_OneOrMore_Max + regExpForFieldNameArea + ".+"; return sourceCodeString.replaceAll(RegExp.CRLF, StringValue.Empty).matches( regExpForPrivateFieldThatHasAccessors); } }
MethodMetaExtractor { boolean isPrivateFieldExists(String fieldType, String fieldName, String sourceCodeString) { Assertion.on("fieldType").mustNotBeEmpty(fieldType); Assertion.on("fieldName").mustNotBeEmpty(fieldName); Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); String regExpForFieldNameArea = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1); String regExpForFieldTypeArea = fieldType.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll(",", "\\\\s*,\\\\s*"); String regExpForPrivateFieldThatHasAccessors = ".*?private\\s+" + regExpForFieldTypeArea + "(" + RegExp.Generics + ")*" + RegExp.WhiteSpace.Consecutive_OneOrMore_Max + regExpForFieldNameArea + ".+"; return sourceCodeString.replaceAll(RegExp.CRLF, StringValue.Empty).matches( regExpForPrivateFieldThatHasAccessors); } MethodMetaExtractor(Configuration config); }
MethodMetaExtractor { boolean isPrivateFieldExists(String fieldType, String fieldName, String sourceCodeString) { Assertion.on("fieldType").mustNotBeEmpty(fieldType); Assertion.on("fieldName").mustNotBeEmpty(fieldName); Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); String regExpForFieldNameArea = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1); String regExpForFieldTypeArea = fieldType.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll(",", "\\\\s*,\\\\s*"); String regExpForPrivateFieldThatHasAccessors = ".*?private\\s+" + regExpForFieldTypeArea + "(" + RegExp.Generics + ")*" + RegExp.WhiteSpace.Consecutive_OneOrMore_Max + regExpForFieldNameArea + ".+"; return sourceCodeString.replaceAll(RegExp.CRLF, StringValue.Empty).matches( regExpForPrivateFieldThatHasAccessors); } MethodMetaExtractor(Configuration config); MethodMetaExtractor initialize(String sourceCodeString); MethodMetaExtractor initialize(ClassMeta classMeta); MethodMetaExtractor initialize(ClassMeta classMeta, String sourceCodeString); List<MethodMeta> extract(String sourceCodeString); }
MethodMetaExtractor { boolean isPrivateFieldExists(String fieldType, String fieldName, String sourceCodeString) { Assertion.on("fieldType").mustNotBeEmpty(fieldType); Assertion.on("fieldName").mustNotBeEmpty(fieldName); Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); String regExpForFieldNameArea = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1); String regExpForFieldTypeArea = fieldType.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll(",", "\\\\s*,\\\\s*"); String regExpForPrivateFieldThatHasAccessors = ".*?private\\s+" + regExpForFieldTypeArea + "(" + RegExp.Generics + ")*" + RegExp.WhiteSpace.Consecutive_OneOrMore_Max + regExpForFieldNameArea + ".+"; return sourceCodeString.replaceAll(RegExp.CRLF, StringValue.Empty).matches( regExpForPrivateFieldThatHasAccessors); } MethodMetaExtractor(Configuration config); MethodMetaExtractor initialize(String sourceCodeString); MethodMetaExtractor initialize(ClassMeta classMeta); MethodMetaExtractor initialize(ClassMeta classMeta, String sourceCodeString); List<MethodMeta> extract(String sourceCodeString);  }