Search in sources :

Example 1 with StructureBuilder

use of org.eclipse.ceylon.cmr.spi.StructureBuilder in project ceylon by eclipse.

the class AbstractOpenNode method getNode.

protected OpenNode getNode(String label, boolean create) {
    final StructureBuilder builder = findService(StructureBuilder.class);
    OpenNode child = create ? builder.create(this, label) : builder.find(this, label);
    if (child != null) {
        child = put(children, label, child);
    }
    return child;
}
Also used : StructureBuilder(org.eclipse.ceylon.cmr.spi.StructureBuilder) OpenNode(org.eclipse.ceylon.cmr.spi.OpenNode)

Example 2 with StructureBuilder

use of org.eclipse.ceylon.cmr.spi.StructureBuilder in project ceylon by eclipse.

the class AetherTestCase method testSimpleTest.

@Test
public void testSimpleTest() throws Throwable {
    StructureBuilder structureBuilder = new AetherContentStore(log, null, null, false, 60000, new File("").getAbsolutePath());
    CmrRepository repository = MavenRepositoryHelper.getMavenRepository(structureBuilder);
    RepositoryManager manager = new SimpleRepositoryManager(repository, log);
    File artifact = manager.getArtifact(MavenArtifactContext.NAMESPACE, "org.slf4j:slf4j-api", "1.6.4");
    boolean exists = false;
    try {
        Assert.assertNotNull(artifact);
        Assert.assertTrue(artifact.exists());
        exists = true;
    } finally {
        if (exists) {
            // delete this one
            Assert.assertTrue(artifact.delete());
        }
    }
}
Also used : SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) StructureBuilder(org.eclipse.ceylon.cmr.spi.StructureBuilder) AetherContentStore(org.eclipse.ceylon.cmr.maven.AetherContentStore) RepositoryManager(org.eclipse.ceylon.cmr.api.RepositoryManager) SimpleRepositoryManager(org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager) CmrRepository(org.eclipse.ceylon.cmr.api.CmrRepository) File(java.io.File) Test(org.junit.Test)

Aggregations

StructureBuilder (org.eclipse.ceylon.cmr.spi.StructureBuilder)2 File (java.io.File)1 CmrRepository (org.eclipse.ceylon.cmr.api.CmrRepository)1 RepositoryManager (org.eclipse.ceylon.cmr.api.RepositoryManager)1 SimpleRepositoryManager (org.eclipse.ceylon.cmr.impl.SimpleRepositoryManager)1 AetherContentStore (org.eclipse.ceylon.cmr.maven.AetherContentStore)1 OpenNode (org.eclipse.ceylon.cmr.spi.OpenNode)1 Test (org.junit.Test)1