Skip to content

Commit

Permalink
Merge pull request #43385 from Shadow-Devil/add-override-annotations
Browse files Browse the repository at this point in the history
Add @OverRide annotations
  • Loading branch information
gimantha authored Sep 14, 2024
2 parents f270bdf + 7a57963 commit 124fdd1
Show file tree
Hide file tree
Showing 180 changed files with 219 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public String getStdOut() {
return output.replace("\r\n", "\n");
}

@Override
public void reset() {
this.stdOutBaOs.reset();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,12 @@ public Object shift(long index) {
return shift(index, "shift");
}

@Override
public Object pop(long index) {
return shift(index, "pop");
}

@Override
public Object remove(long index) {
return shift(index, "remove");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public RunCommandExecutor(RunCommand runCommand, PrintStream outStream) {
this.runtimePanic = false;
}

@Override
public void run() {
// We use the original runCommand instance with the watch field set to false. That will preserve all the
// build options passed by the developer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class AddCommandTest extends BaseCommandTest {
private Path projectPath;
private Path modulesPath;

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public class BuildCommandTest extends BaseCommandTest {
Environment environment = EnvironmentBuilder.getBuilder().setUserHome(customUserHome).build();
ProjectEnvironmentBuilder projectEnvironmentBuilder = ProjectEnvironmentBuilder.getBuilder(environment);

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class BuildNativeImageCommandTest extends BaseCommandTest {
private Path testDistCacheDirectory;
ProjectEnvironmentBuilder projectEnvironmentBuilder;

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
public class CleanCommandTest extends BaseCommandTest {
private Path testResources;

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
public class DocCommandTest extends BaseCommandTest {
private Path testResources;

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public class GraphCommandTest extends BaseCommandTest {
private Path testDistCacheDirectory;
private ProjectEnvironmentBuilder projectEnvironmentBuilder;

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public Object[][] provideInvalidProjectNames() {
};
}

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class PackCommandTest extends BaseCommandTest {
private static final Path logFile = Paths.get("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
.toAbsolutePath();

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void setupSuite() throws IOException {
Files.writeString(logFile, "");
}

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class ProjectWatcherTest extends BaseCommandTest {
private Thread watcherThread;
private AtomicReference<ProjectWatcher> watcher;

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down Expand Up @@ -302,6 +303,7 @@ public void testRunWatchBalProjectWithInvalidFileChanges() throws IOException, I
Assert.assertEquals(actualOutput, expectedOutput);
}

@Override
@AfterMethod
public void afterMethod() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class PushCommandTest extends BaseCommandTest {
private static final String POM_EXTENSION = ".pom";
private Path testResources;

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class RunBuildToolsTaskTest extends BaseCommandTest {
private static final Path LOG_FILE = Paths.get("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
.toAbsolutePath();

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void setupSuite() throws IOException {
Files.writeString(logFile, "");
}

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public class TestCommandTest extends BaseCommandTest {
private Path testDistCacheDirectory;
ProjectEnvironmentBuilder projectEnvironmentBuilder;

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class TestNativeImageCommandTest extends BaseCommandTest {
private static final Path LOG_FILE = Paths.get("build/logs/log_creator_combined_plugin/compiler-plugin.txt")
.toAbsolutePath();

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class ToolCommandTest extends BaseCommandTest {

private Path testResources;

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public function main() {
Assert.assertFalse(lineRangeList.isEmpty());
}

@Override
protected SyntaxTree parseFile(String sourceFileName) {
return super.parseFile(Paths.get("diagnostics").resolve(sourceFileName));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public void testAddMethod() {
statementNodes::add, "node_list_test_07.json");
}

@Override
protected SyntaxTree parseFile(String sourceFileName) {
return super.parseFile(Paths.get("node_list_api").resolve(sourceFileName));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void testAssignmentStmtNodeVisit() {
private static class TokenVisitor extends NodeVisitor {
List<SyntaxKind> tokenList = new ArrayList<>();

@Override
public void visit(Token token) {
tokenList.add(token.kind());
}
Expand All @@ -83,6 +84,7 @@ public void visit(Token token) {
private static class AssignmentStmtVisitor extends NodeVisitor {
List<AssignmentStatementNode> stmtList = new ArrayList<>();

@Override
public void visit(AssignmentStatementNode assignmentStatement) {
stmtList.add(assignmentStatement);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
*/
public class AddModuleToBallerinaTomlCodeActionTest extends AbstractCodeActionTest {

@Override
protected void setupLanguageServer(TestUtil.LanguageServerBuilder builder) {
builder.withInitOption(InitializationOptions.KEY_POSITIONAL_RENAME_SUPPORT, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
public class ActionNodeContextTest extends CompletionTest {

@Override
@Test(dataProvider = "completion-data-provider")
public void test(String config, String configPath) throws IOException, WorkspaceDocumentException {
super.test(config, configPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public Object[][] dataProvider() {
return this.getConfigsList();
}

@Override
@Test(dataProvider = "completion-data-provider")
public void test(String config, String configPath) throws IOException, WorkspaceDocumentException {
super.test(config, configPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@
*/
public class BalaSchemeDefinitionTest extends DefinitionTest {

@Override
@Test(description = "Test goto definitions", dataProvider = "testDataProvider")
public void test(String configPath, String configDir) throws IOException {
super.test(configPath, configDir);
}

@Override
@Test(description = "Test goto definitions for standard libs",
dataProvider = "testStdLibDataProvider")
public void testStdLibDefinition(String configPath, String configDir) throws IOException, URISyntaxException {
super.testStdLibDefinition(configPath, configDir);
}

@Override
@Test(dataProvider = "testInterStdLibDataProvider")
public void testInterStdLibDefinition(String configPath, String configDir) throws IOException, URISyntaxException {
super.testInterStdLibDefinition(configPath, configDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class HoverPerformanceTest extends HoverProviderTest {

private final List<Long> executionTimes = new ArrayList<>();

@Override
@Test(description = "Test Hover provider", dataProvider = "hover-data-provider", enabled = false)
public void testHover(String config) throws IOException {
// We run the same test multiple times and take the average of them as the execution time. This is to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
*/
public class BalaSchemeReferencesTest extends ReferencesTest {

@Override
@Test(description = "Test reference", dataProvider = "testDataProvider")
public void test(String configPath) throws IOException {
super.test(configPath);
}

@Override
@Test(dataProvider = "testReferencesWithinStdLibDataProvider")
public void testReferencesWithinStdLib(String configPath) throws IOException, URISyntaxException {
super.testReferencesWithinStdLib(configPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private Object[][] testDataProvider() {
};
}

@Override
@AfterClass
public void shutDownLanguageServer() throws IOException {
TestUtil.shutdownLanguageServer(this.serviceEndpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @since 2.0.0
*/
public class ActionTest extends AbstractSignatureHelpTest {
@Override
@Test(dataProvider = "signature-help-data-provider", description = "Test Signature Help for Actions")
public void test(String config, String source)
throws WorkspaceDocumentException, InterruptedException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* @since 2.0.0
*/
public class ExpressionsTest extends AbstractSignatureHelpTest {
@Override
@Test(dataProvider = "signature-help-data-provider", description = "Test Signature Help for Expressions")
public void test(String config, String source)
throws WorkspaceDocumentException, InterruptedException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
public class IncludedRecordParameterTest extends AbstractSignatureHelpTest {

@Override
@Test(dataProvider = "signature-help-data-provider", description = "Test Signature Help for Included record params")
public void test(String config, String source)
throws WorkspaceDocumentException, InterruptedException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @since 2.0.0
*/
public class StatementTest extends AbstractSignatureHelpTest {
@Override
@Test(dataProvider = "signature-help-data-provider", description = "Test Signature Help for Statements")
public void test(String config, String source)
throws WorkspaceDocumentException, InterruptedException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class BindgenCommandTest extends BindgenCommandBaseTest {
private Path testResources;
private String newLine = System.lineSeparator();

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down Expand Up @@ -324,6 +325,7 @@ public void testGenerationOfSuperClasses() throws IOException {
"\tjava.lang.Object"));
}

@Override
@AfterClass
public void cleanup() throws IOException {
super.cleanup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class MavenSupportTest extends BindgenCommandBaseTest {

private Path testResources;

@Override
@BeforeClass
public void setup() throws IOException {
super.setup();
Expand Down Expand Up @@ -133,6 +134,7 @@ private boolean isJarAvailable(Path directory, String jarName) {
return matchingFiles != null;
}

@Override
@AfterClass
public void cleanup() throws IOException {
super.cleanup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*/
public class ParserTestFormatter extends FormatterTest {

@Override
@Test(dataProvider = "test-file-provider")
public void test(String fileName, String path) throws IOException {
super.testParserResources(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
public class CheckingActionsTest extends FormatterTest {

@Override
@Test(dataProvider = "test-file-provider")
public void test(String source, String sourcePath) throws IOException {
super.test(source, sourcePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
public class FlushActionsTest extends FormatterTest {

@Override
@Test(dataProvider = "test-file-provider")
public void test(String source, String sourcePath) throws IOException {
super.test(source, sourcePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
public class QueryActionsTest extends FormatterTest {

@Override
@Test(dataProvider = "test-file-provider")
public void test(String source, String sourcePath) throws IOException {
super.test(source, sourcePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
public class SendReceiveActionsTest extends FormatterTest {

@Override
@Test(dataProvider = "test-file-provider")
public void test(String source, String sourcePath) throws IOException {
super.test(source, sourcePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
public class StartActionsTest extends FormatterTest {

@Override
@Test(dataProvider = "test-file-provider")
public void test(String source, String sourcePath) throws IOException {
super.test(source, sourcePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
public class TrapActionsTest extends FormatterTest {

@Override
@Test(dataProvider = "test-file-provider")
public void test(String source, String sourcePath) throws IOException {
super.test(source, sourcePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
public class TypeCastActionsTest extends FormatterTest {

@Override
@Test(dataProvider = "test-file-provider")
public void test(String source, String sourcePath) throws IOException {
super.test(source, sourcePath);
Expand Down
Loading

0 comments on commit 124fdd1

Please sign in to comment.