Package org.apache.geronimo.kernel.mock

Examples of org.apache.geronimo.kernel.mock.MockRepository


    private final Artifact version2 = new Artifact("version", "version", "2", "jar");
    private final Artifact version3 = new Artifact("version", "version", "3", "jar");

    public void testSelectHighestFromRepo() throws Exception {
        ArtifactManager artifactManager = new DefaultArtifactManager();
        MockRepository mockRepository = getRepo();
        ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, mockRepository);

        Artifact unresolvedArtifact = new Artifact("version", "version", (Version) null, "jar");
        Artifact artifact = artifactResolver.resolveInClassLoader(unresolvedArtifact);
        assertEquals(version3, artifact);
View Full Code Here


    private MockRepository getRepo() {
        Set<Artifact> repo = new HashSet<Artifact>();
        repo.add(version1);
        repo.add(version2);
        repo.add(version3);
        return new MockRepository(repo);
    }
View Full Code Here

    public void testAlreadyLoaded() throws Exception {
        ArtifactManager artifactManager = new DefaultArtifactManager();
        artifactManager.loadArtifacts(loader, Collections.singleton(version2));

        MockRepository mockRepository = getRepo();
        ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, mockRepository);

        Artifact unresolvedArtifact = new Artifact("version", "version", (Version) null, "jar");
        Artifact artifact = artifactResolver.resolveInClassLoader(unresolvedArtifact);
        assertEquals(version2, artifact);
View Full Code Here

        Set<Artifact> loaded = new HashSet<Artifact>();
        loaded.add(version1);
        loaded.add(version2);
        artifactManager.loadArtifacts(loader, loaded);

        MockRepository mockRepository = getRepo();
        ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, mockRepository);

        Artifact unresolvedArtifact = new Artifact("version", "version", (Version) null, "jar");
        Artifact artifact = artifactResolver.resolveInClassLoader(unresolvedArtifact);
        assertEquals(version2, artifact);
View Full Code Here

        Artifact artifact = artifactResolver.resolveInClassLoader(unresolvedArtifact);
        assertEquals(version2, artifact);
    }

    public void testParentLoaded() throws Exception {
        MockRepository mockRepository = getRepo();

        ArtifactManager artifactManager = new DefaultArtifactManager();
        Set<Artifact> loaded = new HashSet<Artifact>();
        loaded.add(version1);
        loaded.add(version2);
View Full Code Here

        kernel.loadGBean(artifactManagerData, getClass().getClassLoader());
        kernel.startGBean(artifactManagerData.getAbstractName());
        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(artifactManagerData.getAbstractName()));
        ArtifactManager artifactManager = (ArtifactManager) kernel.getGBean(artifactManagerData.getAbstractName());

        ListableRepository testRepository = new MockRepository(configurations.keySet());
        DefaultArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, testRepository);

        artifact1 = new Artifact("test", "1", "1.1", "bar");
        artifact2 = new Artifact("test", "2", "2.2", "bar");
        artifact3 = new Artifact("test", "3", "3.3", "bar");
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        Set<Artifact> repo = new HashSet<Artifact>();
        repo.add(Artifact.create("org.apache.geronimo.tests/test/1/car"));
        repository = new MockRepository(repo);
        defaultParentId = new Environment();
        defaultParentId.addDependency(new Artifact("org.apache.geronimo.tests", "test", "1", "car"), ImportType.ALL);
    }
View Full Code Here

            Set<Artifact> repo = new HashSet<Artifact>();
            repo.add(Artifact.create("geronimo/foo1/DEV/car"));
            repo.add(Artifact.create("geronimo/foo2/DEV/car"));
            repo.add(Artifact.create("geronimo/foo3/DEV/car"));
            repo.add(Artifact.create("geronimo/foo4/DEV/car"));
            ListableRepository mockRepository = new MockRepository(repo);
            ArtifactManager artifactManager = new DefaultArtifactManager();
            ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.singleton(mockRepository), null);
            ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET);
            AbstractName moduleName = naming.createRootName(environment.getConfigId(), "foo", "bar");
            DeploymentContext context = new DeploymentContext(outFile, null, environment, moduleName, ConfigurationModuleType.CAR, naming, configurationManager, Collections.singleton(mockRepository));
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        Set<Artifact> repo = new HashSet<Artifact>();
        repo.add(Artifact.create("org.apache.geronimo.tests/test/1/car"));
        repository = new MockRepository(repo);
        defaultParentId = new Environment();
        defaultParentId.addDependency(new Artifact("org.apache.geronimo.tests", "test", "1", "car"), ImportType.ALL);
    }
View Full Code Here

            repo.put(Artifact.create("geronimo/foo1/DEV/jar"), file);
            repo.put(Artifact.create("geronimo/foo2/DEV/jar"), file);
            repo.put(Artifact.create("geronimo/foo3/DEV/car"), file);
            repo.put(Artifact.create("geronimo/foo4/DEV/car"), file);

            ListableRepository mockRepository = new MockRepository(repo);
            ArtifactManager artifactManager = new DefaultArtifactManager();
            ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, mockRepository);
            ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET, bundleContext);
            bundleContext.setConfigurationManager(configurationManager);
            AbstractName moduleName = naming.createRootName(environment.getConfigId(), "foo", "bar");
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.mock.MockRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.