Search in sources :

Example 26 with Manifest

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

the class ManifestProcessorTest method testMultipleDependancies.

@Test(description = "Multiple dependencies added to the dependencies section has an effect")
public void testMultipleDependancies() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[dependencies] \n " + "string-utils = {location = \"src/string-utils\", version = \"1.0.5\" } \n " + "jquery = { version = \"2.2.3\" } \n");
    Assert.assertEquals(manifest.getDependencies().get(0).getPackageName(), "string-utils");
    Assert.assertEquals(manifest.getDependencies().get(0).getVersion(), "1.0.5");
    Assert.assertEquals(manifest.getDependencies().get(1).getPackageName(), "jquery");
    Assert.assertEquals(manifest.getDependencies().get(1).getVersion(), "2.2.3");
}
Also used : Manifest(org.ballerinalang.toml.model.Manifest) Test(org.testng.annotations.Test)

Example 27 with Manifest

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

the class ManifestProcessorTest method testSinglePatch.

@Test(description = "One patch added to the patches section has an effect")
public void testSinglePatch() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[patches] \n " + "string-utils = {version = \"1.6.1\", location = \"src/patches/string-utils\" } \n");
    Assert.assertEquals(manifest.getPatches().get(0).getPackageName(), "string-utils");
    Assert.assertEquals(manifest.getPatches().get(0).getVersion(), "1.6.1");
    Assert.assertEquals(manifest.getPatches().get(0).getLocation(), "src/patches/string-utils");
}
Also used : Manifest(org.ballerinalang.toml.model.Manifest) Test(org.testng.annotations.Test)

Example 28 with Manifest

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

the class ManifestProcessorTest method testDescription.

@Test(description = "Description in package section has an effect")
public void testDescription() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[project] \n" + "description = \"This is a description about the package\"");
    Assert.assertEquals(manifest.getDescription(), "This is a description about the package");
}
Also used : Manifest(org.ballerinalang.toml.model.Manifest) Test(org.testng.annotations.Test)

Example 29 with Manifest

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

the class ManifestProcessorTest method testRepositoryURL.

@Test(description = "Repository url in package section has an effect")
public void testRepositoryURL() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[project] \n " + "repository = \"https://github.com/ballerinalang/ballerina\"");
    Assert.assertEquals(manifest.getRepositoryURL(), "https://github.com/ballerinalang/ballerina");
}
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