Search in sources :

Example 6 with Manifest

use of org.ballerinalang.toml.model.Manifest in project ballerina by ballerina-lang.

the class ManifestProcessorTest method testEmptyAuthorArray.

@Test(description = "Empty author array in package section has an effect")
public void testEmptyAuthorArray() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[project] \n" + "authors = []");
    Assert.assertEquals(manifest.getAuthors().size(), 0);
}
Also used : Manifest(org.ballerinalang.toml.model.Manifest) Test(org.testng.annotations.Test)

Example 7 with Manifest

use of org.ballerinalang.toml.model.Manifest in project ballerina by ballerina-lang.

the class ManifestProcessorTest method testHomePageURL.

@Test(description = "Homepage url in package section has an effect")
public void testHomePageURL() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[project] \n " + "homepage = \"https://ballerinalang.org/\"");
    Assert.assertEquals(manifest.getHomepageURL(), "https://ballerinalang.org/");
}
Also used : Manifest(org.ballerinalang.toml.model.Manifest) Test(org.testng.annotations.Test)

Example 8 with Manifest

use of org.ballerinalang.toml.model.Manifest in project ballerina by ballerina-lang.

the class ManifestProcessorTest method testLicenseDescription.

@Test(description = "Description in package section has an effect")
public void testLicenseDescription() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[project] \n " + "license = \"MIT OR Apache-2.0\"");
    Assert.assertEquals(manifest.getLicense(), "MIT OR Apache-2.0");
}
Also used : Manifest(org.ballerinalang.toml.model.Manifest) Test(org.testng.annotations.Test)

Example 9 with Manifest

use of org.ballerinalang.toml.model.Manifest in project ballerina by ballerina-lang.

the class ManifestProcessorTest method testPackageName.

@Test(description = "Package name in package section has an effect")
public void testPackageName() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[project] \n" + "#Name of the package \n org-name = \"foo\"");
    Assert.assertEquals(manifest.getName(), "foo");
}
Also used : Manifest(org.ballerinalang.toml.model.Manifest) Test(org.testng.annotations.Test)

Example 10 with Manifest

use of org.ballerinalang.toml.model.Manifest in project ballerina by ballerina-lang.

the class ManifestProcessorTest method testAuthors.

@Test(description = "Authors in package section has an effect")
public void testAuthors() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[project] \n" + "authors = [\"tyler@wso2.com\", \"manu@wso2.com\"]");
    Assert.assertEquals(manifest.getAuthors().get(0), "tyler@wso2.com");
    Assert.assertEquals(manifest.getAuthors().get(1), "manu@wso2.com");
}
Also used : Manifest(org.ballerinalang.toml.model.Manifest) Test(org.testng.annotations.Test)

Aggregations

Manifest (org.ballerinalang.toml.model.Manifest)29 Test (org.testng.annotations.Test)25 Path (java.nio.file.Path)4 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)2 SrcFile (org.ballerinalang.packerina.init.models.SrcFile)2 PrintStream (java.io.PrintStream)1 URI (java.net.URI)1 Scanner (java.util.Scanner)1 ParseTreeWalker (org.antlr.v4.runtime.tree.ParseTreeWalker)1 BLangCompilerException (org.ballerinalang.compiler.BLangCompilerException)1 CompileResult (org.ballerinalang.launcher.util.CompileResult)1 PackageID (org.ballerinalang.model.elements.PackageID)1 Name (org.wso2.ballerinalang.compiler.util.Name)1