Examples of MockRepository


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

        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

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

    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

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

            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

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

    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

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

            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

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

        bundleContext = new MockBundleContext(getClass().getClassLoader(), "", new HashMap<Artifact, ConfigurationData>(), locations);
        ((MockBundleContext)bundleContext).setConfigurationManager(new MockConfigurationManager());
        bundleContext.registerService(DependencyManager.class.getName(), new MockDependencyManager(bundleContext, Collections.<Repository> emptyList(), null), new Hashtable());
        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

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

            gbean3newer = configurationData3newer.addGBean("gbean3", TestBean.getGBeanInfo()).getAbstractName();
            configStore.install(configurationData3newer);
            configurations.put(artifact3NoVersion, configurationData3newer);
        }

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

        configurationManager = new KernelConfigurationManager(kernel,
                Collections.singleton(configStore),
                null,
View Full Code Here

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

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

    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

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.