Examples of ContentSourceType


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

    protected ContentSourceType getContentSourceType(String typeName) throws Exception {
        getTransactionManager().begin();

        try {
            Query q = em.createNamedQuery(ContentSourceType.QUERY_FIND_BY_NAME_WITH_CONFIG_DEF);
            ContentSourceType type = (ContentSourceType) q.setParameter("name", typeName).getSingleResult();
            return type;
        } catch (NoResultException nre) {
            return null;
        } finally {
            getTransactionManager().rollback();
View Full Code Here

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

    public void testGetSyncResultsList() throws Throwable {
        getTransactionManager().begin();

        try {
            // create a content source type and a content source
            ContentSourceType type = new ContentSourceType("testGetSyncResultsListCST");
            Set<ContentSourceType> types = new HashSet<ContentSourceType>();
            types.add(type);
            contentSourceMetadataManager.registerTypes(types); // this blows away any previous existing types
            ContentSource contentSource = new ContentSource("testGetSyncResultsListCS", type);
            contentSource = contentSourceManager.simpleCreateContentSource(overlord, contentSource);
View Full Code Here

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

        int repoId = 0;
        int contentSourceId = 0;

        try {
            // create content source type
            ContentSourceType type = new ContentSourceType("testMergeSyncReportCST");
            Set<ContentSourceType> types = new HashSet<ContentSourceType>();
            types.add(type);
            contentSourceMetadataManager.registerTypes(types); // this blows away any previous existing types
            type = contentSourceManager.getContentSourceType(type.getName());
            assert type != null;
            assert type.getId() > 0;

            // create content source
            ContentSource contentSource = new ContentSource("testMergeSyncReportCS", type);
            contentSource = contentSourceManager.simpleCreateContentSource(overlord, contentSource);
            assert contentSource != null;
View Full Code Here

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

        int contentSourceId = 0;
        int repoId = 0;

        try {
            // create content source type and content source
            ContentSourceType type = new ContentSourceType("testMergeSyncReportAMUCST");
            Set<ContentSourceType> types = new HashSet<ContentSourceType>();
            types.add(type);
            contentSourceMetadataManager.registerTypes(types); // this blows away any previous existing types
            ContentSource contentSource = new ContentSource("testMergeSyncReportAMUCS", type);
            contentSource.setLazyLoad(true);
View Full Code Here

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

        int contentSourceId = 0;
        int repoId = 0;

        try {
            // create content source type and content source and repo
            ContentSourceType type = new ContentSourceType("testMergeSyncReportAMU2CST");
            Set<ContentSourceType> types = new HashSet<ContentSourceType>();
            types.add(type);
            contentSourceMetadataManager.registerTypes(types); // this blows away any previous existing types
            ContentSource contentSource = new ContentSource("testMergeSyncReportAMU2CS", type);
            contentSource.setLazyLoad(true);
View Full Code Here

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

    @Test(enabled = TESTS_ENABLED)
    public void testDeleteContentSource() throws Exception {
        PageControl pc = PageControl.getUnlimitedInstance();
        // getTransactionManager().begin();
        try {
            ContentSourceType type = null;
            ContentSource contentSource = null;

            int csTypeCount = contentSourceManager.getAllContentSourceTypes().size();
            List csList = contentSourceManager.getAllContentSources(overlord, pc);
            int csCount = contentSourceManager.getAllContentSources(overlord, pc).size();

            // create the content source type
            type = new ContentSourceType("testDel-" + RandomStringUtils.randomAlphanumeric(6));

            Set<ContentSourceType> types = new HashSet<ContentSourceType>();
            types.add(type);
            contentSourceMetadataManager.registerTypes(types); // this blows away any previous existing types
            type = contentSourceManager.getContentSourceType(type.getName());
            assert type != null;
            assert type.getId() > 0;

            // test the getAll API
            assert (csTypeCount + 1) == contentSourceManager.getAllContentSourceTypes().size();

            // create the content source
View Full Code Here

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

    }

    @Test(enabled = TESTS_ENABLED)
    public void testUpdateContentSourceNoConfig() throws Exception {
        try {
            ContentSourceType type = null;
            ContentSource contentSource = null;

            // create the content source type
            type = new ContentSourceType("testUpdateContentSourceCST");
            Set<ContentSourceType> types = new HashSet<ContentSourceType>();
            types.add(type);
            contentSourceMetadataManager.registerTypes(types); // this blows away any previous existing types
            type = contentSourceManager.getContentSourceType(type.getName());
            assert type != null;
            assert type.getId() > 0;

            // create the content source - note it doesn't have any config yet
            contentSource = new ContentSource("testUpdateContentSource", type);
            contentSource = contentSourceManager.simpleCreateContentSource(overlord, contentSource);
            assert contentSource != null;
View Full Code Here

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

    }

    @Test(enabled = TESTS_ENABLED)
    public void testUpdateContentSourceConfig() throws Exception {
        try {
            ContentSourceType type = null;
            ContentSource contentSource = null;

            // create the content source type
            type = new ContentSourceType("testUpdateContentSourceCST2");
            Set<ContentSourceType> types = new HashSet<ContentSourceType>();
            types.add(type);
            contentSourceMetadataManager.registerTypes(types); // this blows away any previous existing types
            type = contentSourceManager.getContentSourceType(type.getName());
            assert type != null;
            assert type.getId() > 0;

            // create the content source - note it has a config that should be persisted
            Configuration config = new Configuration();
            config.put(new PropertySimple("updateCSName", "updateCSValue"));
            contentSource = new ContentSource("testUpdateContentSource2", type);
View Full Code Here

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

        }
    }

    @Test(enabled = TESTS_ENABLED)
    public void testConstraintViolation() throws Exception {
        ContentSourceType type = null;
        ContentSource contentSource = null;

        try {
            type = new ContentSourceType("testConstraintViolationCST");
            Set<ContentSourceType> types = new HashSet<ContentSourceType>();
            types.add(type);
            contentSourceMetadataManager.registerTypes(types); // this blows away any previous existing types
            type = contentSourceManager.getContentSourceType(type.getName());
            assert type != null;
            assert type.getId() > 0;
            contentSource = new ContentSource("testConstraintViolation", type);
            contentSource = contentSourceManager.simpleCreateContentSource(overlord, contentSource);
            assert contentSource != null;
            int contentSourceId = contentSource.getId();
            assert contentSourceId > 0;
View Full Code Here

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

     * @throws Exception
     */
    @Test(enabled = TESTS_ENABLED)
    public void testMergeWithRepo() throws Exception {
        try {
            ContentSourceType type = null;
            ContentSource contentSource = null;

            // create the content source type
            type = new ContentSourceType("testMergeWithRepoCST");
            Set<ContentSourceType> types = new HashSet<ContentSourceType>();
            types.add(type);
            contentSourceMetadataManager.registerTypes(types); // this blows away any previous existing types
            type = contentSourceManager.getContentSourceType(type.getName());
            assert type != null;
            assert type.getId() > 0;

            // create the content source
            contentSource = new ContentSource("testMergeWithRepoCS", type);
            contentSource = contentSourceManager.simpleCreateContentSource(overlord, contentSource);
            assert contentSource != null;
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.