From a7352c4519f27ed154c88f90b03531cfb1be3300 Mon Sep 17 00:00:00 2001 From: Thevakumar-Luheerathan Date: Mon, 9 Oct 2023 10:14:39 +0530 Subject: [PATCH] Address the review comment --- .../java/org/ballerina/projectapi/MavenCustomRepoTest.java | 7 ++----- .../org/ballerina/projectapi/MavenCustomRepoTestUtils.java | 2 +- .../src/test/resources/maven-repos/pact/package.md | 2 +- .../resources/maven-repos/test-resolution/Ballerina.toml | 5 ----- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/project-api-tests/src/test/java/org/ballerina/projectapi/MavenCustomRepoTest.java b/project-api-tests/src/test/java/org/ballerina/projectapi/MavenCustomRepoTest.java index 75b2a090e6..d10aae3dc3 100644 --- a/project-api-tests/src/test/java/org/ballerina/projectapi/MavenCustomRepoTest.java +++ b/project-api-tests/src/test/java/org/ballerina/projectapi/MavenCustomRepoTest.java @@ -53,7 +53,7 @@ */ public class MavenCustomRepoTest { - private static final String org = "luheerathan"; + private static final String org = "bctestorg"; private static final String packagename = "pact"; private static final String version = "0.2.0"; private static final String GITHUB_REPO_ID = "github1"; @@ -62,7 +62,6 @@ public class MavenCustomRepoTest { private Path actualHomeDirectoryClone; private Map envVariables; - @BeforeClass() public void setUp() throws IOException { TestUtils.setupDistributions(); @@ -124,7 +123,6 @@ public void testPullBalaGithub() throws IOException, InterruptedException { .resolve(GITHUB_REPO_ID).resolve("bala").resolve(org).resolve(packagename).resolve(version); Assert.assertTrue(Files.exists(packagePath.resolve("any"))); deleteFiles(this.actualHomeDirectory.resolve("repositories").resolve(GITHUB_REPO_ID), false); - } @Test(description = "Build a package offline using a module from Github packages", @@ -136,7 +134,7 @@ public void testBuildBalaGithubOffline() throws IOException, InterruptedExceptio .resolve("test-resolution"), args, this.envVariables); String buildErrors = getString(build.getErrorStream()); - Assert.assertTrue(buildErrors.contains("cannot resolve module 'luheerathan/pact as _'")); + Assert.assertTrue(buildErrors.contains("cannot resolve module '" + org + "/pact as _'")); } @Test(description = "Build a package Online using a module from Github packages", @@ -156,7 +154,6 @@ public void testBuildBalaGithubOnline() throws IOException, InterruptedException Assert.assertTrue(buildOutput.contains("Generating executable\n\ttarget/bin/test.jar")); } - @AfterClass private void cleanup() throws IOException { deleteFiles(actualHomeDirectory, true); diff --git a/project-api-tests/src/test/java/org/ballerina/projectapi/MavenCustomRepoTestUtils.java b/project-api-tests/src/test/java/org/ballerina/projectapi/MavenCustomRepoTestUtils.java index 46ef73c72b..b4aa7dfdd2 100644 --- a/project-api-tests/src/test/java/org/ballerina/projectapi/MavenCustomRepoTestUtils.java +++ b/project-api-tests/src/test/java/org/ballerina/projectapi/MavenCustomRepoTestUtils.java @@ -41,7 +41,7 @@ public class MavenCustomRepoTestUtils { /** * Create Settings.toml inside the home repository. - * + * @param dirPath folder path to the settings toml * @throws IOException i/o exception when writing to file */ static void createSettingToml(Path dirPath) throws IOException { diff --git a/project-api-tests/src/test/resources/maven-repos/pact/package.md b/project-api-tests/src/test/resources/maven-repos/pact/package.md index 9c3b9c65b2..3806222f94 100644 --- a/project-api-tests/src/test/resources/maven-repos/pact/package.md +++ b/project-api-tests/src/test/resources/maven-repos/pact/package.md @@ -1 +1 @@ -jsjj \ No newline at end of file +jsjj diff --git a/project-api-tests/src/test/resources/maven-repos/test-resolution/Ballerina.toml b/project-api-tests/src/test/resources/maven-repos/test-resolution/Ballerina.toml index bfe56125b4..3bd2b9ad02 100644 --- a/project-api-tests/src/test/resources/maven-repos/test-resolution/Ballerina.toml +++ b/project-api-tests/src/test/resources/maven-repos/test-resolution/Ballerina.toml @@ -6,13 +6,8 @@ version = "0.1.0" [build-options] observabilityIncluded = true - [[dependency]] org = "luheerathan" name = "pact" version = "0.2.0" repository="github1" - - - -