diff --git a/src/test/java/br/unb/cic/analysis/ioa/ClassFieldConflictAnalysisTest.java b/src/test/java/br/unb/cic/analysis/ioa/ClassFieldConflictAnalysisTest.java deleted file mode 100644 index e473032c..00000000 --- a/src/test/java/br/unb/cic/analysis/ioa/ClassFieldConflictAnalysisTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package br.unb.cic.analysis.ioa; - -import br.unb.cic.analysis.AbstractMergeConflictDefinition; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import soot.G; -import soot.PackManager; -import soot.Transform; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Ignore -public class ClassFieldConflictAnalysisTest { - - private InterproceduralOverrideAssignment analysis; - - @Before - public void configure() { - G.reset(); - - AbstractMergeConflictDefinition definition = new AbstractMergeConflictDefinition() { - @Override - protected Map> sourceDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(7); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentClassFieldConflictInterProceduralSample", lines); - return res; - } - - @Override - protected Map> sinkDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(8); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentClassFieldConflictInterProceduralSample", lines); - return res; - } - }; - - analysis = new InterproceduralOverrideAssignment(definition); - - PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); - soot.options.Options.v().setPhaseOption("cg.spark", "on"); - soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); - // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); - - String testClasses = "target/test-classes/"; - soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); - } - - @Test - public void interproceduralOverridingAssignmentTest() { - Assert.assertEquals(1, analysis.getConflicts().size()); - } - -} diff --git a/src/test/java/br/unb/cic/analysis/ioa/ClassFieldConflictAnalysisTest2.java b/src/test/java/br/unb/cic/analysis/ioa/ClassFieldConflictAnalysisTest2.java deleted file mode 100644 index b11f4d37..00000000 --- a/src/test/java/br/unb/cic/analysis/ioa/ClassFieldConflictAnalysisTest2.java +++ /dev/null @@ -1,62 +0,0 @@ -package br.unb.cic.analysis.ioa; - -import br.unb.cic.analysis.AbstractMergeConflictDefinition; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import soot.G; -import soot.PackManager; -import soot.Transform; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Ignore -public class ClassFieldConflictAnalysisTest2 { - - private InterproceduralOverrideAssignment analysis; - - @Before - public void configure() { - G.reset(); - - AbstractMergeConflictDefinition definition = new AbstractMergeConflictDefinition() { - @Override - protected Map> sourceDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(7); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentClassFieldConflictInterProceduralSample2", lines); - return res; - } - - @Override - protected Map> sinkDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(8); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentClassFieldConflictInterProceduralSample2", lines); - return res; - } - }; - - analysis = new InterproceduralOverrideAssignment(definition); - - PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); - soot.options.Options.v().setPhaseOption("cg.spark", "on"); - soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); - // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); - - String testClasses = "target/test-classes/"; - soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); - } - - @Test - public void interproceduralOverridingAssignmentTest() { - Assert.assertEquals(1, analysis.getConflicts().size()); - } - -} diff --git a/src/test/java/br/unb/cic/analysis/ioa/ClassFieldNotConflictAnalysisTest.java b/src/test/java/br/unb/cic/analysis/ioa/ClassFieldNotConflictAnalysisTest.java deleted file mode 100644 index 3bdb5adc..00000000 --- a/src/test/java/br/unb/cic/analysis/ioa/ClassFieldNotConflictAnalysisTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package br.unb.cic.analysis.ioa; - -import br.unb.cic.analysis.AbstractMergeConflictDefinition; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import soot.G; -import soot.PackManager; -import soot.Transform; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Ignore -public class ClassFieldNotConflictAnalysisTest { - - private InterproceduralOverrideAssignment analysis; - - @Before - public void configure() { - G.reset(); - - AbstractMergeConflictDefinition definition = new AbstractMergeConflictDefinition() { - @Override - protected Map> sourceDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(8); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentClassFieldNotConflictInterProceduralSample", lines); - return res; - } - - @Override - protected Map> sinkDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(10); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentClassFieldNotConflictInterProceduralSample", lines); - return res; - } - }; - - analysis = new InterproceduralOverrideAssignment(definition); - - PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); - soot.options.Options.v().setPhaseOption("cg.spark", "on"); - soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); - // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); - - String testClasses = "target/test-classes/"; - soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); - } - - @Test - public void interproceduralOverridingAssignmentTest() { - Assert.assertEquals(0, analysis.getConflicts().size()); - } - -} diff --git a/src/test/java/br/unb/cic/analysis/ioa/ClassFieldNotConflictAnalysisTest2.java b/src/test/java/br/unb/cic/analysis/ioa/ClassFieldNotConflictAnalysisTest2.java deleted file mode 100644 index e4949bcb..00000000 --- a/src/test/java/br/unb/cic/analysis/ioa/ClassFieldNotConflictAnalysisTest2.java +++ /dev/null @@ -1,62 +0,0 @@ -package br.unb.cic.analysis.ioa; - -import br.unb.cic.analysis.AbstractMergeConflictDefinition; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import soot.G; -import soot.PackManager; -import soot.Transform; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Ignore -public class ClassFieldNotConflictAnalysisTest2 { - - private InterproceduralOverrideAssignment analysis; - - @Before - public void configure() { - G.reset(); - - AbstractMergeConflictDefinition definition = new AbstractMergeConflictDefinition() { - @Override - protected Map> sourceDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(8); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentClassFieldNotConflictInterProceduralSample2", lines); - return res; - } - - @Override - protected Map> sinkDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(10); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentClassFieldNotConflictInterProceduralSample2", lines); - return res; - } - }; - - analysis = new InterproceduralOverrideAssignment(definition); - - PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); - soot.options.Options.v().setPhaseOption("cg.spark", "on"); - soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); - // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); - - String testClasses = "target/test-classes/"; - soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); - } - - @Test - public void interproceduralOverridingAssignmentTest() { - Assert.assertEquals(0, analysis.getConflicts().size()); - } - -} diff --git a/src/test/java/br/unb/cic/analysis/ioa/ClassFieldWithParameterNotConflictAnalysisTest.java b/src/test/java/br/unb/cic/analysis/ioa/ClassFieldWithParameterNotConflictAnalysisTest.java deleted file mode 100644 index cc4e97b3..00000000 --- a/src/test/java/br/unb/cic/analysis/ioa/ClassFieldWithParameterNotConflictAnalysisTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package br.unb.cic.analysis.ioa; - -import br.unb.cic.analysis.AbstractMergeConflictDefinition; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import soot.G; -import soot.PackManager; -import soot.Transform; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Ignore -public class ClassFieldWithParameterNotConflictAnalysisTest { - - private InterproceduralOverrideAssignment analysis; - - @Before - public void configure() { - G.reset(); - - AbstractMergeConflictDefinition definition = new AbstractMergeConflictDefinition() { - @Override - protected Map> sourceDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(8); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentClassFieldWithParameterNotConflictInterProceduralSample", lines); - return res; - } - - @Override - protected Map> sinkDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(9); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentClassFieldWithParameterNotConflictInterProceduralSample", lines); - return res; - } - }; - - analysis = new InterproceduralOverrideAssignment(definition); - - PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); - soot.options.Options.v().setPhaseOption("cg.spark", "on"); - soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); - // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); - - String testClasses = "target/test-classes/"; - soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); - } - - @Test - public void interproceduralOverridingAssignmentTest() { - Assert.assertEquals(0, analysis.getConflicts().size()); - } - -} diff --git a/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java b/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java new file mode 100644 index 00000000..24c4eac8 --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java @@ -0,0 +1,129 @@ +package br.unb.cic.analysis.ioa; + +import br.unb.cic.analysis.AbstractMergeConflictDefinition; +import br.unc.cic.analysis.test.DefinitionFactory; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; +import soot.G; +import soot.PackManager; +import soot.Transform; + +@Ignore +public class InterproceduralOverridingAssignmentAnalysisTest { + + + private void configureTest(InterproceduralOverrideAssignment analysis) { + G.reset(); + + PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); + soot.options.Options.v().setPhaseOption("cg.spark", "on"); + soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); + // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); + + String testClasses = "target/test-classes/"; + soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); + } + + @Test + public void classFieldConflict() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentClassFieldConflictInterProceduralSample"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{8}, new int[]{9}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(1, analysis.getConflicts().size()); + } + + @Test + public void classFieldConflict2() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentClassFieldConflictInterProceduralSample2"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{8}, new int[]{9}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(1, analysis.getConflicts().size()); + } + + @Test + public void classFieldNotConflict() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentClassFieldNotConflictInterProceduralSample"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{8}, new int[]{10}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(0, analysis.getConflicts().size()); + } + + @Test + public void classFieldNotConflict2() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentClassFieldNotConflictInterProceduralSample2"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{8}, new int[]{10}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(0, analysis.getConflicts().size()); + } + + @Test + public void classFieldWithParameterNotConflict() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentClassFieldWithParameterNotConflictInterProceduralSample"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{8}, new int[]{9}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(0, analysis.getConflicts().size()); + } + + @Test + public void localVariablesNotConflict() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentLocalVariablesNotConflictInterProceduralSample"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{6}, new int[]{7}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(0, analysis.getConflicts().size()); + } + + @Test + public void localVariablesNotConflict2() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentLocalVariablesNotConflictInterProceduralSample2"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{6}, new int[]{7}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(0, analysis.getConflicts().size()); + } + + @Test + public void localVariablesWithParameterNotConflict() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentLocalVariablesWithParameterNotConflictInterProceduralSample"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{6}, new int[]{7}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(0, analysis.getConflicts().size()); + } + + @Test + public void objectFieldConflict() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentObjectFieldConflictInterProceduralSample"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{7}, new int[]{9}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(1, analysis.getConflicts().size()); + } + + @Test + public void objectFieldNotConflict() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentObjectFieldNotConflictInterProceduralSample"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{8}, new int[]{9}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(0, analysis.getConflicts().size()); + } + + +} diff --git a/src/test/java/br/unb/cic/analysis/ioa/LocalVariablesNotConflictAnalysisTest.java b/src/test/java/br/unb/cic/analysis/ioa/LocalVariablesNotConflictAnalysisTest.java deleted file mode 100644 index 9cea33c1..00000000 --- a/src/test/java/br/unb/cic/analysis/ioa/LocalVariablesNotConflictAnalysisTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package br.unb.cic.analysis.ioa; - -import br.unb.cic.analysis.AbstractMergeConflictDefinition; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import soot.G; -import soot.PackManager; -import soot.Transform; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Ignore -public class LocalVariablesNotConflictAnalysisTest { - - private InterproceduralOverrideAssignment analysis; - - @Before - public void configure() { - G.reset(); - - AbstractMergeConflictDefinition definition = new AbstractMergeConflictDefinition() { - @Override - protected Map> sourceDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(6); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentLocalVariablesNotConflictInterProceduralSample", lines); - return res; - } - - @Override - protected Map> sinkDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(7); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentLocalVariablesNotConflictInterProceduralSample", lines); - return res; - } - }; - - analysis = new InterproceduralOverrideAssignment(definition); - - PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); - soot.options.Options.v().setPhaseOption("cg.spark", "on"); - soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); - // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); - - String testClasses = "target/test-classes/"; - soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); - } - - @Test - public void interproceduralOverridingAssignmentTest() { - Assert.assertEquals(0, analysis.getConflicts().size()); - } - -} diff --git a/src/test/java/br/unb/cic/analysis/ioa/LocalVariablesNotConflictAnalysisTest2.java b/src/test/java/br/unb/cic/analysis/ioa/LocalVariablesNotConflictAnalysisTest2.java deleted file mode 100644 index 26442530..00000000 --- a/src/test/java/br/unb/cic/analysis/ioa/LocalVariablesNotConflictAnalysisTest2.java +++ /dev/null @@ -1,62 +0,0 @@ -package br.unb.cic.analysis.ioa; - -import br.unb.cic.analysis.AbstractMergeConflictDefinition; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import soot.G; -import soot.PackManager; -import soot.Transform; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Ignore -public class LocalVariablesNotConflictAnalysisTest2 { - - private InterproceduralOverrideAssignment analysis; - - @Before - public void configure() { - G.reset(); - - AbstractMergeConflictDefinition definition = new AbstractMergeConflictDefinition() { - @Override - protected Map> sourceDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(6); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentLocalVariablesNotConflictInterProceduralSample2", lines); - return res; - } - - @Override - protected Map> sinkDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(7); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentLocalVariablesNotConflictInterProceduralSample2", lines); - return res; - } - }; - - analysis = new InterproceduralOverrideAssignment(definition); - - PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); - soot.options.Options.v().setPhaseOption("cg.spark", "on"); - soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); - // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); - - String testClasses = "target/test-classes/"; - soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); - } - - @Test - public void interproceduralOverridingAssignmentTest() { - Assert.assertEquals(0, analysis.getConflicts().size()); - } - -} diff --git a/src/test/java/br/unb/cic/analysis/ioa/LocalVariablesWithParameterNotConflictAnalysisTest.java b/src/test/java/br/unb/cic/analysis/ioa/LocalVariablesWithParameterNotConflictAnalysisTest.java deleted file mode 100644 index 91f16249..00000000 --- a/src/test/java/br/unb/cic/analysis/ioa/LocalVariablesWithParameterNotConflictAnalysisTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package br.unb.cic.analysis.ioa; - -import br.unb.cic.analysis.AbstractMergeConflictDefinition; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import soot.G; -import soot.PackManager; -import soot.Transform; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Ignore -public class LocalVariablesWithParameterNotConflictAnalysisTest { - - private InterproceduralOverrideAssignment analysis; - - @Before - public void configure() { - G.reset(); - - AbstractMergeConflictDefinition definition = new AbstractMergeConflictDefinition() { - @Override - protected Map> sourceDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(6); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentLocalVariablesWithParameterNotConflictInterProceduralSample", lines); - return res; - } - - @Override - protected Map> sinkDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(7); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentLocalVariablesWithParameterNotConflictInterProceduralSample", lines); - return res; - } - }; - - analysis = new InterproceduralOverrideAssignment(definition); - - PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); - soot.options.Options.v().setPhaseOption("cg.spark", "on"); - soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); - // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); - - String testClasses = "target/test-classes/"; - soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); - } - - @Test - public void interproceduralOverridingAssignmentTest() { - Assert.assertEquals(0, analysis.getConflicts().size()); - } - -} diff --git a/src/test/java/br/unb/cic/analysis/ioa/ObjectFieldConflictAnalysisTest.java b/src/test/java/br/unb/cic/analysis/ioa/ObjectFieldConflictAnalysisTest.java deleted file mode 100644 index d5ea9999..00000000 --- a/src/test/java/br/unb/cic/analysis/ioa/ObjectFieldConflictAnalysisTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package br.unb.cic.analysis.ioa; - -import br.unb.cic.analysis.AbstractMergeConflictDefinition; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import soot.G; -import soot.PackManager; -import soot.Transform; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Ignore -public class ObjectFieldConflictAnalysisTest { - - private InterproceduralOverrideAssignment analysis; - - @Before - public void configure() { - G.reset(); - - AbstractMergeConflictDefinition definition = new AbstractMergeConflictDefinition() { - @Override - protected Map> sourceDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(7); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentObjectFieldConflictInterProceduralSample", lines); - return res; - } - - @Override - protected Map> sinkDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(9); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentObjectFieldConflictInterProceduralSample", lines); - return res; - } - }; - - analysis = new InterproceduralOverrideAssignment(definition); - - PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); - soot.options.Options.v().setPhaseOption("cg.spark", "on"); - soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); - // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); - - String testClasses = "target/test-classes/"; - soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); - } - - @Test - public void interproceduralOverridingAssignmentTest() { - Assert.assertEquals(1, analysis.getConflicts().size()); - } - -} diff --git a/src/test/java/br/unb/cic/analysis/ioa/ObjectFieldNotConflictAnalysisTest.java b/src/test/java/br/unb/cic/analysis/ioa/ObjectFieldNotConflictAnalysisTest.java deleted file mode 100644 index e8192a0e..00000000 --- a/src/test/java/br/unb/cic/analysis/ioa/ObjectFieldNotConflictAnalysisTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package br.unb.cic.analysis.ioa; - -import br.unb.cic.analysis.AbstractMergeConflictDefinition; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import soot.G; -import soot.PackManager; -import soot.Transform; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Ignore -public class ObjectFieldNotConflictAnalysisTest { - - private InterproceduralOverrideAssignment analysis; - - @Before - public void configure() { - G.reset(); - - AbstractMergeConflictDefinition definition = new AbstractMergeConflictDefinition() { - @Override - protected Map> sourceDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(7); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentObjectFieldNotConflictInterProceduralSample", lines); - return res; - } - - @Override - protected Map> sinkDefinitions() { - Map> res = new HashMap<>(); - List lines = new ArrayList<>(); - lines.add(9); - res.put("br.unb.cic.analysis.samples.OverridingAssignmentObjectFieldNotConflictInterProceduralSample", lines); - return res; - } - }; - - analysis = new InterproceduralOverrideAssignment(definition); - - PackManager.v().getPack("wjtp").add(new Transform("wjtp.analysis", analysis)); - soot.options.Options.v().setPhaseOption("cg.spark", "on"); - soot.options.Options.v().setPhaseOption("cg.spark", "verbose:true"); - // PhaseOptions.v().setPhaseOption("jb", "use-original-names:true"); - - String testClasses = "target/test-classes/"; - soot.Main.main(new String[]{"-w", "-allow-phantom-refs", "-f", "J", "-keep-line-number", "-process-dir", testClasses}); - } - - @Test - public void interproceduralOverridingAssignmentTest() { - Assert.assertEquals(0, analysis.getConflicts().size()); - } - -}