Skip to content

Commit

Permalink
Enable block tracking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Apr 10, 2024
1 parent 4d7b714 commit cb72979
Show file tree
Hide file tree
Showing 23,842 changed files with 5,127,122 additions and 11 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
347 changes: 347 additions & 0 deletions src/main/java/org/codetracker/BlockTrackerWithLocalFiles.java

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/main/java/org/codetracker/api/BlockTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import gr.uom.java.xmi.LocationInfo.CodeElementType;
import org.codetracker.element.Block;
import org.codetracker.BlockTrackerImpl;
import org.codetracker.BlockTrackerWithLocalFiles;
import org.eclipse.jgit.lib.Repository;

public interface BlockTracker extends CodeTracker {
Expand All @@ -11,6 +12,7 @@ public interface BlockTracker extends CodeTracker {

class Builder {
private Repository repository;
private String gitURL;
private String startCommitId;
private String filePath;
private String methodName;
Expand All @@ -24,6 +26,11 @@ public BlockTracker.Builder repository(Repository repository) {
return this;
}

public Builder gitURL(String gitURL) {
this.gitURL = gitURL;
return this;
}

public BlockTracker.Builder startCommitId(String startCommitId) {
this.startCommitId = startCommitId;
return this;
Expand Down Expand Up @@ -68,5 +75,11 @@ public BlockTracker build() {
return new BlockTrackerImpl(repository, startCommitId, filePath, methodName, methodDeclarationLineNumber,
codeElementType, blockStartLineNumber, blockEndLineNumber);
}

public BlockTracker buildWithLocalFiles() {
checkInput();
return new BlockTrackerWithLocalFiles(gitURL, startCommitId, filePath, methodName, methodDeclarationLineNumber,
codeElementType, blockStartLineNumber, blockEndLineNumber);
}
}
}
20 changes: 9 additions & 11 deletions src/test/java/org/codetracker/util/BlockOracleTest.java
Original file line number Diff line number Diff line change
@@ -1,40 +1,38 @@
package org.codetracker.util;

import gr.uom.java.xmi.LocationInfo;

import java.io.IOException;
import java.util.stream.Stream;

import org.codetracker.api.BlockTracker;
import org.codetracker.api.CodeTracker;
import org.codetracker.api.History;
import org.codetracker.element.Block;
import org.codetracker.experiment.oracle.BlockOracle;
import org.codetracker.experiment.oracle.history.BlockHistoryInfo;
import org.eclipse.jgit.lib.Repository;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.params.provider.Arguments;

import java.io.IOException;
import java.util.stream.Stream;

@Disabled
public class BlockOracleTest extends OracleTest {
private static final String EXPECTED = System.getProperty("user.dir") + "/src/test/resources/block/";

private static History<Block> blockTracker(BlockHistoryInfo blockHistoryInfo, Repository repository) throws Exception {
private static History<Block> blockTracker(BlockHistoryInfo blockHistoryInfo, String gitURL) throws Exception {
BlockTracker blockTracker = CodeTracker
.blockTracker()
.repository(repository)
.gitURL(gitURL)
.filePath(blockHistoryInfo.getFilePath())
.startCommitId(blockHistoryInfo.getStartCommitId())
.methodName(blockHistoryInfo.getFunctionName())
.methodDeclarationLineNumber(blockHistoryInfo.getFunctionStartLine())
.codeElementType(LocationInfo.CodeElementType.valueOf(blockHistoryInfo.getBlockType()))
.blockStartLineNumber(blockHistoryInfo.getBlockStartLine())
.blockEndLineNumber(blockHistoryInfo.getBlockEndLine())
.build();
.buildWithLocalFiles();
return blockTracker.track();
}
/*

public static Stream<Arguments> testProvider() throws IOException {
return getArgumentsStream(BlockOracle.all(), EXPECTED, BlockOracleTest::blockTracker);
}
*/

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"commitLogMap":{"119fd4fb33bef9f5c66fc950396669af842c21a3":["746a9d69125211ff44af1cb37732e919368ba620","0847a10b9430d9fb0a3f44df03e891da906bea47","c6d822904862d8a0f4d2d3f9ccc17c5c8f8078fc","327c0bc843612486ab4ded32a2f01038e1271fd0","dabb75d43c7e02317565dde4c5e60f380d3b16b8","35c607f167d79343258926919799dab9bce9d33b","8ca6e3a6f7c2dec0c1c961b0d7cc7f3f537686b8","127f729942afa7d645db2e41c1b3ebe4c12be6c4","b16aef991830dd1fce1ce2640af7e7db8b329d86","370ce010137d2f43c7284750d551acfd295ebea9","8a3d250422eb4c805a09d1678552985b74d4cea4","a43191d49473b50097f172884a2bf55494c49567","7caba87cc7113bf4484ca6046483a7a9bad58ec8","b4a337a599e853cdc44b19a76da28fcfab2956cd","ec2834e43a38c63774dc34a4ebafb783fcb68ca2","b61daf7f44e5b3a817e712b6af84d6bca796fb28","56cc11416ebdf52dd299d11424fb04fda42fa63f","8c8fee7432c89b47936c27bcc2c7f60f5cc79923","fbaabe83cf78bcaf563443a3fb866931239eb15b","c2847eae889fbeee9d93e875bcc7f72c3eb9fc0b","fbf3f95c2273be23b966cba6e6ef89390a6fb020","25a37e5049b7816b34c552899841a978efc37a63","de022d2434e58dd633fd50a7f9bb50565a8767b5","39b343a32a4f1ce18ee98a34618fda0a5404d6a0","ecbeaa6e1df7cb021745e111b04395b9fbd509c7","871b20e88b5bfedb324f3e1996b37d0c68eb727b","6273f207202078c76b8451a841ceb62ef6fe05ed","3b9b0d1e92f3b3bd90b50acb61223c9f7e466c16","167dd96d8ca503a472bf003f187191d6b0ce586c","8ad9441bbb78695a924be63444222ae80cfcf114","f6bec165c9c6b6d8cc430cb0694dd42ccb0b7f69","77acd41cf13e912caf8e68f92550a6e0b928de92","d46c2cf0e9df06bb5f424dbd7645574f082f7609","617ebf2bf27d284dcc7b866f85439fcf6dab3402","2864c10cd45d23b91717299954aaaf41d36a6cb0","f020066f8bdfb378df36904af3df8b5bc48858fd","ce196814d857a4244a80c51d5151cc35e90b6749","2b4a02d2c8a498a8a1ee38e9396426209fa65fad","49a0ee81710e0c43ed06a01f1d64ac7f5598a934","c899af31c112c07ea1244f6bbe2c5c6c56818ae5","a1128cd7428ba71035c132a072de0da2e5c4c9cd","5ca96679525171c73fc4d5c257301f51d2100071","cf85a72f3decb315c878505f474ae96b35c41431","5922d5a6730d7582d7d66121eb911ef9426f9e24","d740f2e1cdb05f20a48bf7d5dcebdcd0faae6ddd","46a52f84c014e4d25379f429f11ed3de11fe8ae7","95f8b08af84a2287dbd93c9cc740b6732e9e43b1","cdf3e56bacd3895262af8a1df9ca5c81f4071970","ed595de84fba2db507adaf01d04cb089a5e0bac5","efa16e17bf710b7b24af828296c2337612912ba9","54ccca18635a4aeea90da86d30590df498f76b08","26774cf3102640084d88aa60dc928cd0cd783793","7b34e9d7cd424732e7a9035f8ba795369157d6ab","3bd699bd593414d63c7139aa410f13ec8341a027","1935bed5772c0a939b9168b81acd2ab5aa800538","6d5c0da42fa54ceabbc1959e9db354ed64a2ff86","f7f377f5065c11d31b29fb8df19a14220ffb8500","f1e80e4ecae727087ca135dfd02f72e2d6213efb","ead1a5e5dca96e2ad15426696f48a9c244385aff","acbd47a66b01acc392a7bd37ad3a2e65eecd308a","864cf936cfa75116153e5f195a833edaf64a90cf","0f58857d73933c7b6b7e62f0c7c16ad7af51556f","e1a27939aea00c2bb9fa3f54a5256559a410846e","a2b8be14bb1230f1b184701bae8bcc7af102bb25","31421dcdda3b3534f2fcc5c6e88a8fdbc5d15311","c0446a825514ea0279b8c22f633f2c4e3c73dc1f","f374e2e7a0b0fe2df21ed85aef77a91630b1dd66","b29ca6b5f676e92243186abdba84a7501baea1bd","dd6b080a16e0933b3d19305f84ba01c8893839f3","ee518dfe86b29d1fa4d76f0dc0c11fb83afafda1","3a20dbe8edafe0cca300b7b9dfa48effa9a36a06","d347f55756052db6b23ae41168c44e324807c621","1c15b6a36baa68dc3f2ebdf9baac131e98bb9e04","1bd30555eac039d0486dffb3fc43b7a34117909b","c9a9e6508c15e00cf6820b213d79d5ebf41c6343","ca634f7cafbf0d8f21eac1c4badacbe2f3cf8832","204c073294cdca6756bcd546d6af85a797ad7d79","b8ca6a585b824e91b3b8c72dd5cc53c0eb0ab0f1","8ec1a1a97188c112f4af5cc00caffae2ac0cc530","7aa061665c2b005f97b0c05bf03604636175dc9a","465efcd6e07314f81381551c338a50aede5d6626","dfb851e673a879120c80caca7167de3e5c3aa662","f1efb27670a93690577f1bae17fc9dcbd88a795d"],"1cdaeaaa4fbf02a7388f1fcbea1c86ef0ea32fed":["b54981a73d7cf9867207639c919df49684ae2451","1d614c3a7ecf8a3ede4df8a50da46e71792d0025","788f87df4db1368ee0563e1ba1199177618cc01f","b0c33771f097f4895746eaddd40cb159e5bc5bee","68f1a6fa63b635da214ce6cfffd9f8c283248f60","a9c2910a9d58a4b1b8c2d5555fff9cea297c6df5","e00c478dd61d9d883e41b500b780ab217582c2e7","6f46bd4e83204417edf9605f97098bb9d34da728","4218884ee87436e45bc590291e5f3c7175f67930","3cd6646941eca3da7d3b9a221c88e4c1d214876e","523080bbf2be11354b94b851ac85d06e7e8a2c14","216fcb79f9f5bbd05244364e926f261a90e697d1","326e3ae67b8cc2a1dcbcf2356b30fd9a4afa964a","f1fcae23142431016234774318e6ce3b5ccb48f4","2e4762f1716c8d12c9652aad68cb4558181bb60c","13b7c634337e38d20daa92ca9d5e069a2e72ec55","b3f724f871dd57c4db958556df1a73f71c8bd6e5","06e8a4eaa00e548f52b2483864a31ba9defd0989","7552a0b72e07c9a0070e84789b5abe6d293de6e0","fe9057366308642868c25d427c3ee94411b37170","315033ff5647ef9896130573d9212fee6fe141db","fd90bd5aa5cd623b08a2e44ef05e8fac8045d333","5a7e221b757e91d49be1aea105eb4b839e653fbd","f38d8abd42c3e824635e542e6031b3da1997c02e","e50e1fcd1c17ba1f73d11df38382907cc163a1d1","f1afaf83f39b83cc3bd07a2388448b262652a76b","1efc394250b8f1c79bd7f8344b738a7d13396ed3","35d1673788bbbac8263fdb69275dc6a63b095a24","c2d3932843e70e4bb5df7161800aca248f9af778","1aee9d55cc5bd8cca011e17369f6e370efcc85bb","8fe7c3a914d75fa7b20fb5115b08dade9ed7c88c","4d1a6a0b47e36de20106f7b2c2a77033358bfdea","0d887cde58e54d920644ee543dab346b93e8aae9","06b377b34cb81a6ba3fe48880c31a9a093b2a473","5d7063c660b241bce251f1a8c89394619f2791fb","80c8e1c7a8f32c0dd263fdd30d9d87ade317f51c","c1a79b112296dac813d0b4326043590f2eb2c378","5670252b46f4915b276e647fa000361915eb4ff4","778e844080c9cf97da565368e775c8b980bdcf00","33f75977205625bc5f9620a2c63e16a11f9663a5","66325cbd72882454193765322efa716537ce9c93","e708beb537e90a913c8692174dbdf48c5277d014","984eb8d7427038effd8ee8d2d9c90c74eee57e2b","76ed2bf2d6eb9a19dd7c74e717ba3c5cbd7600eb","57ea0b6a1151ec75189f9ee12d29f9b226767fd5","1846dacad6c2a3a04b3350b45bb8b05835192296","1e7d8eef0641edcf97316618c8fab40bd248133d","51dae59b8dcfb5a34f2a8a5b3e788eb6599a1df3","f55fcd5462624e611212b0b6c41e842d1adfa9f2","21f0b07bd031f022d14106150af66ceddb4c06b8","8dc1a8ab994076f3fc10bab9248a2439ee54b443","a4222b86ea273554e5f42c834dd81a029a069ac1","343250f12c479f304ff382cfd74919cbe050381e","c3baa3fa77f4ed8e475ab52db6d0f2f860d93ef0","768256c32a3e397f837ce27602bda49e3c5e0062","889587fdd22ba03ea670e404d36810e9af113c9d","f2b01a44a216e88957eb6cb22e4b0e39429a6c84","7dd1ab24d1a75687f426cb43a6e70d18d435b0a7","f0edd3eaf152d377cf8ec47574cf042c0fc14543","22ad233fd89ff9ccf7f42057be128048612f0080","e904c086077a9ba279b9f983d6ceb817a7f8176d","d216ec75255a120ce7c24e51da7df63a2b9864de","085edafb3bafb0ab31e1ef19bad39984ba9b9d2a","eeba08c1028a79bdc2140476b24ce8d60f04657a","10330437ddd4be125cb4109702d0d0b96ffe3303","feda6ebbfbe510a7572d403f581e8c5f78a6d987","2a71cac7e02c012add5e75f35aaf6aca7c561401","88e89a138aa39f50f7642106cde6568f6e07783f","fedf99f9a85f1a9db30f14ae072769d4ab6ac010","08d6efe49d2960d9bd61bfb9cca65910f0c19b58","52fc35e8b6f0b710409d20192661199a20ece339","2e0c946e06057d552d3846c35140538dc53a2c47","6b55f0fc42d2bffa12048d6d085dcbe394e7162a","419d9243861ac99e80a7783547a51adf8b284817","4d769d48f134d2e7d40111763e29f0870c9a7db5","16ba5b35f9f346e7cea294afaad7f9211605ecaa","ce9f55c439621cd2a130519aea0ca4367bc7c67c","0fb155232fd68c4a4546ec34e676fa655d7fe223","6ffc8dd26075456b055ffcd35d3915c23049bfbb","085befb3adfaed30db6623bfc04fa7b1e8755d3a","109b8f02b6c5ce0f985e7280f28160a47b18c2f1","0ff652ab527f7cb2102cc61839ea6a23eba1b2bc","6568a9b88220366da3fc9e58fc9de93af9a6520d","abff1a2489ea8af10e1bc0a335551262d22f44e7","54a09706ec1db32435b09e6b6910813325558f8d","82b2ba526976588d550cac698e512f8de6c1ffc6","93390fbc8a6952bbb20571ac1b18a705814fc219","822384a711290170148b43b5ae390dd4e8cfaf4f","3c0608f33a6c41cf96056c52ae99070cbe5062d5","788044ce8170fb926d33d0a048b3caa5152aca65","6f4247181beca3530b5c2dc762d9c5c6a018a06c","42a0f5684e1e25e2e119d3c052579af30de1884d","4cbd709c019cf1b69796858506d673f7b66d37c7","5fc3ff2bfbed94f88e1af95f38e970a832e4dbe6","3288a81e30ddea194f76bd74f3b509500b864163","2effcfd0bcdfa7fc25bfff22e6f893ac6fb4478b","7af9e82fc16545a8153b529fba91df0fb310e2e6","c28f32e2a8067514aefbc198f24744401c1a8c87","51941dcf2475545cee7b754acd5e2494c53acf9c","eb7b7bfd3e63a926c3f3b2801d519caa0e1fffc3","021d6344b68b3fe5317a43079c89ab91f047fd47","d7c1da9a93994f9a6125dcbde13976aea3f4b924","4f6596703fa79f08617a41f53e24aff32821a2c6","d077a402da51bb238a7da99d5e2542437b145192","03c8a0a7ee9fa35ce22491785c9630c2eb698471","563f76592dcacffc676e62691c306788b2a38396","b84b3fd04ad9c45e1466e35b707a2b59f5baf66b","03f8352479400cd2c80511bfe0242932a4f00f11","4880b50a3a89db93e7e7c1b8bae8036ec06e186b","672b27dd5551de63a1fb08d8ea80376d70f2aa60","aff5047c9e29ed3fa0a502dd9713fc5aae55146e","eec6e39766631091c0549642bfccc4603adef6c5","25a13442f2d67729eba3b1e8eff32ed926396ee3","751257987b2ef5f301e2deb3b55302196e5015af","ecc852d48b9d26398926b255e3cd68572119c106","20483ae032296610315fafb9a8774cfdd0e13857","c682b5725d22afc38bf19d9667b23a7deab6d8c3","7521f1897b007e3acc06ea3330df5124f4206589","add2bdfb27494bff5fa9c305d9782f57c6170b18","bbe51f6884ac0a961f55310e15ec90411709d970","032b3801aa80bff181235ddd05244d07cc5f43f8","8f8879df46592e6e35658026c354b804ef328097","6970485b88600343de72af03a6bf87cf78e6cf55","cbb5f228d8070bd9cc8f16638f3abe50a7273905","da5d8c09d268342836be6e6b7b4e45403d542b81","190c0e5ca6cff056a136bc2c17f7678eb10686c7","dd476d336818a95e58163cd1c4f8cb00be239eae","b671e6bb1c0652cfc1ccd07355cac99df584eb2f","e2ec464f27b2e30ee66802cb9f8f1899b2dc4a24","ec1e3e834918a32d63025d60175189b3437769d7","41e20895745606d3888500523284e24f15ac13e6","f4860ef3b4536407751eaca2c7f1da60da628ebc","c85ec6f26ade692103ac27383a87c3402b4d66ca","ea01eaaa85409442aeece8763f0388066bd07bf5","6df3e84393d095000c982b2087344de84a91f9ef","c617457933a978f5fd861d7ea43d05bccf045c16","b779f3c1da7bacfe57900ccba7cd95de7ab54071","15c7162ea43a4e7517227a281f6f34d4a2ecb5a5","f755213c9e8f55286776975bfc62d91a99e8c7cb","8d6fa332a9c8b0c350dfcb1d923d70bc5f3d921b","f8ea4c69a2228c5aca6c0b6e08a39a613d157708","edf2c95634cd0c657465723eb0dc2e6f1834eeba","efcb63fd741d3e07f37e986e2d8ab6fe6da8d43b","fb830fc73e3607ae40e89ad69aa00d19de47b868","030798a11d2d21330cbdddd159cdc1824492157a","0e3fe5643667a53079dbd114e5b1e9aa91fde083","6c304950f62f06cb3c72e46869c3fa3fbdc1e7d7","69138e40225407ef560fd9d06d2903de37c83c2c","0fd69594a4c3e82f92f93f0371791da66938f8c3"]}}
Loading

0 comments on commit cb72979

Please sign in to comment.