changes
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
# This workflow will build a Java project with Maven
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||
|
||||
name: Java CI with Maven
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
@@ -6,6 +6,8 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resource" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resource/testFiles" type="java-test-resource" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package edu.lu.uni.serval.fixminer.akka;
|
||||
package edu.lu.uni.serval.fixminer.ediff;
|
||||
|
||||
/**
|
||||
* Created by anilkoyuncu on 18/09/2018.
|
||||
@@ -1,6 +1,5 @@
|
||||
package edu.lu.uni.serval.fixminer.ediff;
|
||||
|
||||
import edu.lu.uni.serval.fixminer.akka.BaseMessage;
|
||||
import redis.clients.jedis.JedisPool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class EDiffParser extends Parser {
|
||||
* @param revFile
|
||||
* @return
|
||||
*/
|
||||
protected List<HierarchicalActionSet> parseChangedSourceCodeWithGumTree2(File prevFile, File revFile,String srcMLPath,boolean isJava) {
|
||||
public List<HierarchicalActionSet> parseChangedSourceCodeWithGumTree2(File prevFile, File revFile,String srcMLPath,boolean isJava) {
|
||||
List<HierarchicalActionSet> actionSets = new ArrayList<>();
|
||||
// GumTree results
|
||||
// boolean isJava =false;
|
||||
|
||||
@@ -15,7 +15,7 @@ inputPath = /Users/anil.koyuncu/projects/test/fixminer-data/patches
|
||||
#redisPath = /Users/anil.koyuncu/projects/fixminer/fixminer-core/python/data/redis
|
||||
redisPath = /Users/anil.koyuncu/projects/test/fixminer-core/python/data/redis
|
||||
#srcMLPath= /Users/anil.koyuncu/Downloads/srcML.0.9.5/bin/srcml
|
||||
srcMLPath= /Users/anil.koyuncu/projects/test/srcML/bin/srcml
|
||||
srcMLPath= /usr/local/bin/srcml
|
||||
#srcMLPath= /usr/local/bin/srcml
|
||||
actionType = ALL
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package edu.lu.uni.serval.FixPatternMiner;
|
||||
|
||||
import edu.lu.uni.serval.fixminer.ediff.EDiffHunkParser;
|
||||
import edu.lu.uni.serval.fixminer.ediff.HierarchicalActionSet;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
public class BaseTest {
|
||||
|
||||
public List<HierarchicalActionSet> getHierarchicalActionSets(String s) throws IOException {
|
||||
Properties appProps = new Properties();
|
||||
|
||||
|
||||
|
||||
|
||||
appProps.load(new FileInputStream("src/main/resource/app.properties"));
|
||||
String srcMLPath = appProps.getProperty("srcMLPath", "FORKJOIN");
|
||||
// String root = appProps.getProperty("inputPath");
|
||||
String root = "src/main/resource/testFiles";
|
||||
root = root + "/codeflaws/";
|
||||
String filename = s;
|
||||
try{
|
||||
File revFile = new File(root + "revFiles/" + filename);
|
||||
File prevFile = new File(root + "prevFiles/prev_" + filename);
|
||||
|
||||
EDiffHunkParser parser = new EDiffHunkParser();
|
||||
|
||||
|
||||
List<HierarchicalActionSet> hierarchicalActionSets = parser.parseChangedSourceCodeWithGumTree2(prevFile, revFile, srcMLPath,false);
|
||||
return hierarchicalActionSets;
|
||||
}catch (NullPointerException n){
|
||||
// String cmd = "cp /Users/anil.koyuncu/projects/test/fixminer-data/patches/codeflaws/"+n.getMessage().split(root)[1] + " /Users/anil.koyuncu/projects/test/fixminerC/"+n.getMessage();
|
||||
// CallShell cs = new CallShell();
|
||||
// try {
|
||||
// cs.runShell(cmd);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+6
-3
@@ -1,11 +1,14 @@
|
||||
package edu.lu.uni.serval.fixminer.ediff;
|
||||
package edu.lu.uni.serval.FixPatternMiner;
|
||||
|
||||
import com.github.gumtreediff.tree.ITree;
|
||||
import edu.lu.uni.serval.fixminer.ediff.EDiffHunkParser;
|
||||
import edu.lu.uni.serval.fixminer.ediff.HierarchicalActionSet;
|
||||
import edu.lu.uni.serval.utils.ClusterToPattern;
|
||||
import edu.lu.uni.serval.utils.EDiffHelper;
|
||||
import edu.lu.uni.serval.utils.PoolBuilder;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.javatuples.Pair;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import redis.clients.jedis.JedisPool;
|
||||
|
||||
@@ -14,8 +17,8 @@ import java.io.IOException;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
|
||||
public class HunkParserTest {
|
||||
@Ignore
|
||||
public class HunkParserTest extends BaseTest{
|
||||
|
||||
@Test
|
||||
public void testSimple() throws IOException {
|
||||
+4
-2
@@ -1,5 +1,7 @@
|
||||
package edu.lu.uni.serval.fixminer.ediff;
|
||||
package edu.lu.uni.serval.FixPatternMiner;
|
||||
|
||||
import edu.lu.uni.serval.fixminer.ediff.EDiffHunkParser;
|
||||
import edu.lu.uni.serval.fixminer.ediff.HierarchicalActionSet;
|
||||
import edu.lu.uni.serval.utils.CallShell;
|
||||
import edu.lu.uni.serval.utils.EDiffHelper;
|
||||
import org.junit.Assert;
|
||||
@@ -11,7 +13,7 @@ import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
@Ignore
|
||||
public class TestInputCases {
|
||||
|
||||
|
||||
+5
-2
@@ -1,7 +1,10 @@
|
||||
package edu.lu.uni.serval.fixminer.ediff;
|
||||
package edu.lu.uni.serval.FixPatternMiner;
|
||||
|
||||
import edu.lu.uni.serval.fixminer.ediff.EDiffHunkParser;
|
||||
import edu.lu.uni.serval.fixminer.ediff.HierarchicalActionSet;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
@@ -15,7 +18,7 @@ import java.util.Properties;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Ignore
|
||||
public class TestIntroClass {
|
||||
|
||||
|
||||
+5
-2
@@ -1,7 +1,10 @@
|
||||
package edu.lu.uni.serval.fixminer.ediff;
|
||||
package edu.lu.uni.serval.FixPatternMiner;
|
||||
|
||||
|
||||
import edu.lu.uni.serval.fixminer.ediff.EDiffHunkParser;
|
||||
import edu.lu.uni.serval.fixminer.ediff.HierarchicalActionSet;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
@@ -9,7 +12,7 @@ import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
@Ignore
|
||||
public class TestPredefinedCases {
|
||||
|
||||
|
||||
+6
-31
@@ -1,9 +1,12 @@
|
||||
package edu.lu.uni.serval.fixminer.ediff;
|
||||
package edu.lu.uni.serval.FixPatternMiner;
|
||||
|
||||
import com.github.gumtreediff.tree.ITree;
|
||||
import edu.lu.uni.serval.fixminer.ediff.EDiffHunkParser;
|
||||
import edu.lu.uni.serval.fixminer.ediff.HierarchicalActionSet;
|
||||
import edu.lu.uni.serval.utils.CallShell;
|
||||
import edu.lu.uni.serval.utils.EDiffHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
@@ -11,8 +14,8 @@ import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
public class TestRealCases {
|
||||
@Ignore
|
||||
public class TestRealCases extends BaseTest {
|
||||
|
||||
|
||||
|
||||
@@ -864,35 +867,7 @@ public class TestRealCases {
|
||||
"------------------INS literal:number@@3 @TO@ expr@@3 @AT@ 352 @LENGTH@ 1\n");
|
||||
}
|
||||
|
||||
public List<HierarchicalActionSet> getHierarchicalActionSets(String s) throws IOException {
|
||||
Properties appProps = new Properties();
|
||||
appProps.load(new FileInputStream("src/main/resource/app.properties"));
|
||||
String srcMLPath = appProps.getProperty("srcMLPath", "FORKJOIN");
|
||||
// String root = appProps.getProperty("inputPath");
|
||||
String root = "src/main/resource/testFiles";
|
||||
root = root + "/codeflaws/";
|
||||
String filename = s;
|
||||
try{
|
||||
File revFile = new File(root + "revFiles/" + filename);
|
||||
File prevFile = new File(root + "prevFiles/prev_" + filename);
|
||||
|
||||
EDiffHunkParser parser = new EDiffHunkParser();
|
||||
|
||||
|
||||
List<HierarchicalActionSet> hierarchicalActionSets = parser.parseChangedSourceCodeWithGumTree2(prevFile, revFile, srcMLPath,false);
|
||||
return hierarchicalActionSets;
|
||||
}catch (NullPointerException n){
|
||||
String cmd = "cp /Users/anil.koyuncu/projects/test/fixminer-data/patches/codeflaws/"+n.getMessage().split(root)[1] + " /Users/anil.koyuncu/projects/test/fixminerC/"+n.getMessage();
|
||||
CallShell cs = new CallShell();
|
||||
try {
|
||||
cs.runShell(cmd);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user