Package org.rhq.core.domain.content

Examples of org.rhq.core.domain.content.Repo


@Test
public class SerializableTest {
    public void testSerialization() {
        List<Serializable> objects = new ArrayList<Serializable>();
        Serializable[] simpleObjects = new Serializable[] { new AvailabilityReport("fakeAgent"), new PackageType(),
            new Architecture(), new Repo(), new ContentServiceRequest(), new ContentSource(), new ContentSourceType(),
            new InstalledPackage(), new Package(), new PackageInstallationStep(), new PackageType(),
            new PackageVersion() };
        objects.addAll(Arrays.asList(simpleObjects));

        ResourceType resourceType = new ResourceType("name", "plugin", ResourceCategory.PLATFORM, null);
View Full Code Here


    @Test(enabled = ENABLED)
    public void createJobDataMap() throws Exception {
        // Setup
        String repoName = "testRepo";
        Repo repo = new Repo(repoName);

        JobDataMap existingMap = new JobDataMap();
        JobDetail detail = new JobDetail();
        detail.setJobDataMap(existingMap);
View Full Code Here

    }

    @Test(enabled = ENABLED)
    public void createJobName() throws Exception {
        // Setup
        Repo repo = new Repo("testRepo");

        // Test
        Set<String> jobNames = new HashSet<String>(1);

        jobNames.add(RepoSyncJob.createJobName(repo));
View Full Code Here

    }

    @Test(enabled = ENABLED)
    public void createUniqueJobName() throws Exception {
        // Setup
        Repo repo = new Repo("testRepo");

        // Test
        Set<String> jobNames = new HashSet<String>(1);

        jobNames.add(RepoSyncJob.createUniqueJobName(repo));
View Full Code Here

        nonSyncSource = new ContentSource("testSource2", testSourceType);
        contentManager.simpleCreateContentSource(overlord, nonSyncSource);
        entityManager.flush();

        // Add existing repo against other source (this shouldn't show up in the request for packages)
        nonCandidateOnOtherSource = new Repo("nonCandidateOnOtherSource");
        nonCandidateOnOtherSource.setCandidate(false);
        nonCandidateOnOtherSource.addContentSource(nonSyncSource);
        repoManager.createRepo(overlord, nonCandidateOnOtherSource);

        tx.commit();
View Full Code Here

            RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal();
            SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
            Subject overlord = subjectManager.getOverlord();

            // -> Add an already imported repo to the system so it already exists when the report introduces it
            Repo existingImportedRepo = new Repo(TestContentProvider.EXISTING_IMPORTED_REPO_NAME);
            existingImportedRepo.setCandidate(false);
            repoManager.createRepo(overlord, existingImportedRepo);

            // -> Add an already imported repo that wasn't introduced from the report; a user created repo
            Repo customImportedRepo = new Repo(CUSTOM_IMPORTED_REPO_NAME);
            customImportedRepo.setCandidate(false);
            customImportedRepo.addContentSource(syncSource);
            repoManager.createRepo(overlord, customImportedRepo);

            // -> Simulate a candidate repo from a previous import that will be in this report as well
            Repo existingCandidateRepo = new Repo(TestContentProvider.EXISTING_CANDIDATE_REPO_NAME);
            existingCandidateRepo.setCandidate(true);
            repoManager.createRepo(overlord, existingCandidateRepo);

            // -> Simulate a candidate repo from a previous import that will *NOT* be in this report
            Repo previousRepo = new Repo(PREVIOUS_CANDIDATE_REPO_NAME);
            previousRepo.setCandidate(true);
            previousRepo.addContentSource(syncSource);
            repoManager.createRepo(overlord, previousRepo);

            // Test
            // --------------------------------------------
            // TestContentProviderManager providerManager = new TestContentProviderManager();
            pluginService.getContentProviderManager().testConnection(syncSource.getId());

            boolean completed = pluginService.getContentProviderManager()
                .synchronizeContentProvider(syncSource.getId());
            assert completed;

            // Verify RepoGroups
            RepoGroup repoGroup = repoManager.getRepoGroupByName("testRepoGroup");
            assert repoGroup != null;
            repoGroupsToDelete.add(repoGroup.getId());

            // Verify Repos
            // --------------------------------------------
            List<Repo> retrievedRepos;

            // -> Simple Repo
            retrievedRepos = repoManager.getRepoByName("testRepo1");
            assert retrievedRepos.size() == 1;
            assert retrievedRepos.get(0).isCandidate();
            reposToDelete.add(retrievedRepos.get(0).getId());

            // -> Repo in a group
            retrievedRepos = repoManager.getRepoByName("testRepo2");
            assert retrievedRepos.size() == 1;
            assert retrievedRepos.get(0).isCandidate();
            reposToDelete.add(retrievedRepos.get(0).getId());

            Repo repoInGroup = retrievedRepos.get(0);

            RepoCriteria findWithRepoGroup = new RepoCriteria();
            findWithRepoGroup.fetchRepoRepoGroups(true);
            findWithRepoGroup.addFilterId(repoInGroup.getId());

            PageList<Repo> repoPageList = repoManager.findReposByCriteria(overlord, findWithRepoGroup);
            repoInGroup = repoPageList.get(0);

            Set<RepoRepoGroup> repoGroups = repoInGroup.getRepoRepoGroups();
            assert repoGroups.size() == 1;

            RepoRepoGroup repoRepoGroup = repoGroups.iterator().next();
            assert repoRepoGroup.getRepoRepoGroupPK().getRepoGroup().getName().equals("testRepoGroup");
            assert repoRepoGroup.getRepoRepoGroupPK().getRepo().getName().equals("testRepo2");

            // -> Repo with a parent
            retrievedRepos = repoManager.getRepoByName("testRepo3");
            assert retrievedRepos.size() == 1;
            assert retrievedRepos.get(0).isCandidate();
            reposToDelete.add(retrievedRepos.get(0).getId());
            relatedRepoId = retrievedRepos.get(0).getId();

            retrievedRepos = repoManager.getRepoByName("testRepo4");
            assert retrievedRepos.size() == 1;
            assert retrievedRepos.get(0).isCandidate();
            reposToDelete.add(retrievedRepos.get(0).getId());
            repoId = retrievedRepos.get(0).getId();

            RepoCriteria findWithRelationships = new RepoCriteria();
            findWithRelationships.addFilterName("testRepo4");
            findWithRelationships.fetchRepoRepoRelationships(true);
            PageList<Repo> childRepoList = repoManager.findReposByCriteria(overlord, findWithRelationships);
            assert childRepoList.size() == 1;

            Repo childRepo = childRepoList.get(0);
            Set<RepoRepoRelationship> childRepoRepoRelationship = childRepo.getRepoRepoRelationships();
            assert childRepoRepoRelationship.size() == 1;

            // -> Repo that was already imported in the system (make sure there is still only one)
            retrievedRepos = repoManager.getRepoByName(TestContentProvider.EXISTING_IMPORTED_REPO_NAME);
            assert retrievedRepos.size() == 1;
View Full Code Here

        // we installed version 2.5 then upgraded to 3.0
        // now we want to revert back to 2.5
        ResourceType resourceType = new ResourceType("testSimpleBundle2Type", "plugin", ResourceCategory.SERVER, null);
        BundleType bundleType = new BundleType("testSimpleBundle2BType", resourceType);
        Repo repo = new Repo("test-bundle-two");
        PackageType packageType = new PackageType("test-bundle-two", resourceType);
        Bundle bundle = new Bundle("test-bundle-two", bundleType, repo, packageType);
        BundleVersion bundleVersion = new BundleVersion("test-bundle-two", "2.5", bundle,
            getRecipeFromFile("test-bundle-two.xml"));
        BundleDestination destination = new BundleDestination(bundle, "testSimpleBundle2Dest", new ResourceGroup(
View Full Code Here

     *                   if false, this will put some junk files in the dest directory
     */
    private void doAntBundleInitialInstall(boolean startClean) throws Exception {
        ResourceType resourceType = new ResourceType("testSimpleBundle2Type", "plugin", ResourceCategory.SERVER, null);
        BundleType bundleType = new BundleType("testSimpleBundle2BType", resourceType);
        Repo repo = new Repo("test-bundle-two");
        PackageType packageType = new PackageType("test-bundle-two", resourceType);
        Bundle bundle = new Bundle("test-bundle-two", bundleType, repo, packageType);
        BundleVersion bundleVersion = new BundleVersion("test-bundle-two", "2.5", bundle,
            getRecipeFromFile("test-bundle-two.xml"));
        BundleDestination destination = new BundleDestination(bundle, "testSimpleBundle2Dest", new ResourceGroup(
View Full Code Here

     */
    @Test(enabled = ENABLE_TESTS)
    public void testAntBundle() throws Exception {
        ResourceType resourceType = new ResourceType("testSimpleBundle", "plugin", ResourceCategory.SERVER, null);
        BundleType bundleType = new BundleType("testSimpleBundle", resourceType);
        Repo repo = new Repo("testSimpleBundle");
        PackageType packageType = new PackageType("testSimpleBundle", resourceType);
        Bundle bundle = new Bundle("testSimpleBundle", bundleType, repo, packageType);
        BundleVersion bundleVersion = new BundleVersion("testSimpleBundle", "1.0", bundle,
            getRecipeFromFile("test-bundle.xml"));
        BundleDestination destination = new BundleDestination(bundle, "testSimpleBundle", new ResourceGroup(
View Full Code Here

        // our test bundle's relative raw file paths that resolve above dest dir will resolve to here
        final File externalDir = new File(this.testFilesBaseDir, "ext");

        ResourceType resourceType = new ResourceType("testSimpleBundle", "plugin", ResourceCategory.SERVER, null);
        BundleType bundleType = new BundleType("testSimpleBundle", resourceType);
        Repo repo = new Repo("testSimpleBundle");
        PackageType packageType = new PackageType("testSimpleBundle", resourceType);
        Bundle bundle = new Bundle("testSimpleBundle", bundleType, repo, packageType);
        BundleVersion bundleVersion = new BundleVersion("testSimpleBundle", "1.0", bundle,
            getRecipeFromFile("test-bundle-dotdot.xml"));
        BundleDestination destination = new BundleDestination(bundle, "testSimpleBundle", new ResourceGroup(
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.content.Repo

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.