Skip to content

Commit 14883e8

Browse files
committed
Add validations for Move Code refactoring in benchmark 2
1 parent bc1e5a7 commit 14883e8

File tree

7 files changed

+41
-1
lines changed

7 files changed

+41
-1
lines changed

src/test/java/org/refactoringminer/test/TestNewDatasetRefactorings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ public void testAllRefactorings() throws Exception {
5151
.or(Refactorings.MoveCode.getValue());
5252
TestBuilder test = new TestBuilder(detector, REPOS, types);
5353
RefactoringPopulator.feedTSERefactoringInstances(test);
54-
test.assertExpectationsWithGitHubAPI(3419, 50, 114);
54+
test.assertExpectationsWithGitHubAPI(3427, 53, 114);
5555
}
5656
}

src/test/resources/oracle/tse-dataset/elasticsearch.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,16 @@
644644
"type": "CHANGE_VARIABLE_TYPE",
645645
"description": "Change Variable Type\treducedBuckets : List<Bucket> to reducedBuckets : List<InternalIpPrefix.Bucket> in method public get() : InternalAggregation from class org.elasticsearch.search.aggregations.bucket.prefix.InternalIpPrefix.getLeaderReducer.new AggregatorReducer",
646646
"validation": true
647+
},
648+
{
649+
"type": "MOVE_CODE",
650+
"description": "Move Code\tfrom protected getLeaderReducer(reduceContext AggregationReduceContext, size int) : AggregatorReducer to public InternalDateHistogram(in StreamInput) in class org.elasticsearch.search.aggregations.bucket.histogram.InternalDateHistogram",
651+
"validation": true
652+
},
653+
{
654+
"type": "MOVE_CODE",
655+
"description": "Move Code\tfrom protected getLeaderReducer(reduceContext AggregationReduceContext, size int) : AggregatorReducer to public InternalHistogram(in StreamInput) in class org.elasticsearch.search.aggregations.bucket.histogram.InternalHistogram",
656+
"validation": true
647657
}
648658
]
649659
},

src/test/resources/oracle/tse-dataset/jetty.project.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,11 @@
10291029
"type": "REPLACE_ATTRIBUTE_WITH_VARIABLE",
10301030
"description": "Replace Attribute With Variable\t_maxSize : int to maxSize : int in method public emit(field HttpField) : void from class org.eclipse.jetty.http2.hpack.MetaDataBuilder",
10311031
"validation": true
1032+
},
1033+
{
1034+
"type": "MOVE_CODE",
1035+
"description": "Move Code\tfrom public Parser(byteBufferPool ByteBufferPool, listener Listener, maxDynamicTableSize int, maxHeaderSize int, rateControl RateControl) to public init(listener Listener) : void in class org.eclipse.jetty.http2.parser.Parser",
1036+
"validation": true
10321037
}
10331038
]
10341039
},

src/test/resources/oracle/tse-dataset/jgit.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,16 @@
923923
"type": "MOVE_ATTRIBUTE",
924924
"description": "Move Attribute\tprivate homeDir : File from class org.eclipse.jgit.junit.ssh.SshTestHarness to private homeDir : File from class org.eclipse.jgit.junit.LocalDiskRepositoryTestCase",
925925
"validation": true
926+
},
927+
{
928+
"type": "MOVE_CODE",
929+
"description": "Move Code\tfrom public shutdownServer() : void in class org.eclipse.jgit.junit.ssh.SshTestHarness to public tearDown() : void in class org.eclipse.jgit.junit.LocalDiskRepositoryTestCase",
930+
"validation": true
931+
},
932+
{
933+
"type": "MOVE_CODE",
934+
"description": "Move Code\tfrom public setUp() : void in class org.eclipse.jgit.junit.ssh.SshTestHarness to public setUp() : void in class org.eclipse.jgit.junit.LocalDiskRepositoryTestCase",
935+
"validation": true
926936
}
927937
]
928938
},

src/test/resources/oracle/tse-dataset/mockito.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@
300300
"type": "INLINE_VARIABLE",
301301
"description": "Inline Variable\targuments : Object[] in method public forEachMatcherAndArgument(action ArgumentMatcherAction) : boolean from class org.mockito.internal.invocation.MatcherApplicationStrategy",
302302
"validation": true
303+
},
304+
{
305+
"type": "MOVE_CODE",
306+
"description": "Move Code\tfrom private MatcherApplicationStrategy(invocation Invocation, matchers List<ArgumentMatcher<?>>, matchingType MatcherApplicationType) to public forEachMatcherAndArgument(action ArgumentMatcherAction) : boolean in class org.mockito.internal.invocation.MatcherApplicationStrategy",
307+
"validation": true
303308
}
304309
]
305310
},

src/test/resources/oracle/tse-dataset/okhttp.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,11 @@
827827
"type": "CHANGE_VARIABLE_TYPE",
828828
"description": "Change Variable Type\tcodePoint : int to s : String in method public canonicalize(s String) : String from class okhttp3.UrlComponentEncodingTester.Component",
829829
"validation": false
830+
},
831+
{
832+
"type": "MOVE_CODE",
833+
"description": "Move Code\tfrom public test(component Component) : UrlComponentEncodingTester to private testUri(codePoint int, codePointString String, encoding Encoding, component Component) : void in class okhttp3.UrlComponentEncodingTester",
834+
"validation": true
830835
}
831836
]
832837
},

src/test/resources/oracle/tse-dataset/spring-boot.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,11 @@
498498
"type": "RENAME_METHOD",
499499
"description": "Rename Method\tpackage afterAll() : void renamed to package afterEach() : void in class org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinHttpClientSenderTests",
500500
"validation": true
501+
},
502+
{
503+
"type": "MOVE_CODE",
504+
"description": "Move Code\tfrom package beforeAll() : void to package beforeEach() : void in class org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinHttpClientSenderTests",
505+
"validation": true
501506
}
502507
]
503508
},

0 commit comments

Comments
 (0)