Skip to content

Commit

Permalink
test(spgroup#31): add logging test
Browse files Browse the repository at this point in the history
  • Loading branch information
barbosamaatheus committed Nov 24, 2021
1 parent cff2893 commit 6b4d7a3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ private void exportResults(Set<Conflict> 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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
}
}

}

0 comments on commit 6b4d7a3

Please sign in to comment.