Search in sources :

Example 1 with Manifest

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

the class ManifestProcessorTest method testKeywords.

@Test(description = "Keywords in package section has an effect")
public void testKeywords() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[project] \n" + "keywords=[\"ballerina\",\"security\",\"security\"]");
    Assert.assertEquals(manifest.getKeywords().get(0), "ballerina");
    Assert.assertEquals(manifest.getKeywords().get(1), "security");
    Assert.assertEquals(manifest.getKeywords().size(), 3);
}
Also used : Manifest(org.ballerinalang.toml.model.Manifest) Test(org.testng.annotations.Test)

Example 2 with Manifest

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

the class ManifestProcessorTest method testReadmeFilePath.

@Test(description = "Readme file path in package section has an effect")
public void testReadmeFilePath() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[project] \n " + "readme = \"https://github.com/ballerinalang/composer/blob/master/README.md\"");
    Assert.assertEquals(manifest.getReadmeFilePath(), "https://github.com/ballerinalang/composer/blob" + "/master/README.md");
}
Also used : Manifest(org.ballerinalang.toml.model.Manifest) Test(org.testng.annotations.Test)

Example 3 with Manifest

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

the class ManifestProcessorTest method testSingleDependanciesAdded.

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

Example 4 with Manifest

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

the class ManifestProcessorTest method testSingleDependancies.

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

Example 5 with Manifest

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

the class ManifestProcessorTest method testVersionNeg.

@Test(description = "Version in non-package section has no effect")
public void testVersionNeg() throws IOException {
    Manifest manifest = ManifestProcessor.parseTomlContentFromString("[patch] \n version = \"v1\"");
    Assert.assertNotEquals(manifest.getVersion(), "v1");
}
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