use of org.ballerinalang.toml.model.Manifest in project ballerina by ballerina-lang.
the class ManifestProcessorTest method testMixtureOfDependencies.
@Test(description = "Dependencies added both ways i.e. individually and multiple dependencies together has" + "an effect")
public void testMixtureOfDependencies() throws IOException {
Manifest manifest = ManifestProcessor.parseTomlContentFromString("[dependencies.string-utils] \n " + "version = \"1.5\" \n location = \"src/string-utils\" \n [dependencies] \n " + "jquery = {version = \"2.2.3\"} \n react = {version = \"1.6.6\", location = \"npm-modules/react\"} \n" + "[dependencies.toml] \n version = \"1.4.5\" \n ");
Assert.assertEquals(manifest.getDependencies().size(), 4);
Assert.assertEquals(manifest.getDependencies().get(0).getPackageName(), "string-utils");
Assert.assertEquals(manifest.getDependencies().get(0).getVersion(), "1.5");
Assert.assertEquals(manifest.getDependencies().get(0).getLocation(), "src/string-utils");
Assert.assertEquals(manifest.getDependencies().get(1).getPackageName(), "jquery");
Assert.assertEquals(manifest.getDependencies().get(1).getVersion(), "2.2.3");
Assert.assertEquals(manifest.getDependencies().get(1).getLocation(), null);
Assert.assertEquals(manifest.getDependencies().get(2).getPackageName(), "react");
Assert.assertEquals(manifest.getDependencies().get(2).getVersion(), "1.6.6");
Assert.assertEquals(manifest.getDependencies().get(2).getLocation(), "npm-modules/react");
Assert.assertEquals(manifest.getDependencies().get(3).getPackageName(), "toml");
Assert.assertEquals(manifest.getDependencies().get(3).getVersion(), "1.4.5");
}
use of org.ballerinalang.toml.model.Manifest in project ballerina by ballerina-lang.
the class ManifestProcessorTest method testSingleEmptyDependancies.
@Test(description = "Empty dependency added to the dependencies section has no effect")
public void testSingleEmptyDependancies() throws IOException {
Manifest manifest = ManifestProcessor.parseTomlContentFromString("[dependencies] \n " + "string-utils = {} \n");
Assert.assertEquals(manifest.getDependencies().get(0).getPackageName(), "string-utils");
}
use of org.ballerinalang.toml.model.Manifest in project ballerina by ballerina-lang.
the class ManifestProcessorTest method testMultipleDependanciesAddedIndividually.
@Test(description = "Multiple dependencies added to the dependencies section individually has an effect")
public void testMultipleDependanciesAddedIndividually() throws IOException {
Manifest manifest = ManifestProcessor.parseTomlContentFromString("[dependencies.string-utils] \n " + "version = \"1.1.5\" \n location = \"src/string-utils\" \n [dependencies.jquery] \n " + "version = \"2.2.3\"");
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");
Assert.assertEquals(manifest.getDependencies().get(1).getPackageName(), "jquery");
Assert.assertEquals(manifest.getDependencies().get(1).getVersion(), "2.2.3");
Assert.assertEquals(manifest.getDependencies().get(1).getLocation(), null);
}
use of org.ballerinalang.toml.model.Manifest in project ballerina by ballerina-lang.
the class ManifestProcessorTest method testDependenciesAndPatches.
@Test(description = "Dependencies and patches added together has an effect")
public void testDependenciesAndPatches() throws IOException {
Manifest manifest = ManifestProcessor.parseTomlContentFromString("[dependencies.string-utils] \n " + "version = \"1.1.5\" \n location = \"src/string-utils\" \n [patches] \n jobapi = {version =" + "\"2.23\"} \n [dependencies] \n jquery = {version = \"2.2.3\"} \n react = {version = \"1.6.6\", " + "location = \"npm-modules/react\"} \n [patches.toml] \n version = \"0.4.5\" \n");
Assert.assertEquals(manifest.getDependencies().size(), 3);
Assert.assertEquals(manifest.getPatches().size(), 2);
Assert.assertEquals(manifest.getDependencies().get(0).getPackageName(), "string-utils");
Assert.assertEquals(manifest.getDependencies().get(0).getVersion(), "1.1.5");
Assert.assertEquals(manifest.getDependencies().get(1).getPackageName(), "jquery");
Assert.assertEquals(manifest.getDependencies().get(2).getVersion(), "1.6.6");
Assert.assertEquals(manifest.getPatches().get(0).getPackageName(), "jobapi");
Assert.assertEquals(manifest.getPatches().get(1).getPackageName(), "toml");
}
use of org.ballerinalang.toml.model.Manifest in project ballerina by ballerina-lang.
the class ManifestProcessorTest method testDocumentationURL.
@Test(description = "Documentation url in package section has an effect")
public void testDocumentationURL() throws IOException {
Manifest manifest = ManifestProcessor.parseTomlContentFromString("[project] \n " + "documentation = \"https://ballerinalang.org/docs/api/0.95.5/\"");
Assert.assertEquals(manifest.getDocumentationURL(), "https://ballerinalang.org/docs/api/0.95.5/");
}
Aggregations