diff --git a/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java b/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java index 8fc145fa..72687456 100644 --- a/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java +++ b/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java @@ -65,6 +65,16 @@ private void exportResults(Set conflicts) throws Exception { System.out.println("----------------------------"); } + @Test + public void loggingTest() { + String sampleClassPath = "br.unb.cic.analysis.samples.ioa.LoggingConflictSample"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{13}, new int[]{10}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(1, analysis.getConflicts().size()); + } + @Test public void defaultConstructorTest() { String sampleClassPath = "br.unb.cic.analysis.samples.ioa.DefaultConstructorConflictSample"; diff --git a/src/test/java/br/unb/cic/analysis/samples/ioa/LoggingConflictSample.java b/src/test/java/br/unb/cic/analysis/samples/ioa/LoggingConflictSample.java new file mode 100644 index 00000000..775423d8 --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/ioa/LoggingConflictSample.java @@ -0,0 +1,17 @@ +package br.unb.cic.analysis.samples.ioa; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class LoggingConflictSample { + private final Log logger = LogFactory.getLog(getClass()); + + public void logAutoConfigurationReport() { + this.logger.info("Error starting ApplicationContext."); + + if (this.logger.isDebugEnabled()) { + this.logger.debug("Unable to provide auto-configuration report"); + } + } + +}