Program: 138038
Project: 138038
Buggy source:
/** 
 * TDQ-5241 Test method for  {@link org.talend.dataprofiler.core.ui.utils.ModelElementIndicatorRule#patternRule(org.talend.dq.nodes.indicator.type.IndicatorEnum,orgomg.cwm.objectmodel.core.ModelElement,org.talend.dataquality.analysis.ExecutionLanguage)}.
 */
@Test public void testPatternRule(){
  TdSqlDataType tdsql=mock(TdSqlDataType.class);
  TdColumn me=mock(TdColumn.class);
  when(me.getSqlDataType()).thenReturn(tdsql);
  when(tdsql.getJavaDataType()).thenReturn(Types.TIME);
  when(me.getContentType()).thenReturn("String_Node_Str");
  Assert.assertTrue(ModelElementIndicatorRule.patternRule(IndicatorEnum.ModeIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.FrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.LowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.DateFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.WeekFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.MonthFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.QuarterFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.YearFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.DateLowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.WeekLowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.MonthLowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.QuarterLowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.YearLowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
}

Fixed version (ground truth):
/** 
 * TDQ-5241 Test method for  {@link org.talend.dataprofiler.core.ui.utils.ModelElementIndicatorRule#patternRule(org.talend.dq.nodes.indicator.type.IndicatorEnum,orgomg.cwm.objectmodel.core.ModelElement,org.talend.dataquality.analysis.ExecutionLanguage)}.
 */
@Test public void testPatternRule(){
  TdSqlDataType tdsql=mock(TdSqlDataType.class);
  TdColumn me=mock(TdColumn.class);
  when(me.getSqlDataType()).thenReturn(tdsql);
  when(tdsql.getJavaDataType()).thenReturn(Types.TIME);
  when(me.getContentType()).thenReturn("String_Node_Str");
  Assert.assertTrue(ModelElementIndicatorRule.patternRule(IndicatorEnum.ModeIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.DateFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.WeekFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.MonthFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.QuarterFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.YearFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.DateLowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.WeekLowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.MonthLowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.QuarterLowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
  Assert.assertFalse(ModelElementIndicatorRule.patternRule(IndicatorEnum.YearLowFrequencyIndicatorEnum,me,ExecutionLanguage.JAVA));
}