Package org.jitterbit.integration.data.entity

Examples of org.jitterbit.integration.data.entity.RootFolder


        project = IntegrationProject.createNewProject("Test");
    }
   
    @Test
    public void testGetAllEntities() {
        RootFolder schedules = project.getRootFolder(EntityType.Schedule);
        Schedule s1 = new Schedule("s1");
        schedules.addItem(s1);
        Schedule s2 = new Schedule("s2");
        schedules.addItem(s2);
        Folder f1 = new Folder("F1", EntityType.Schedule);
        Schedule s3 = new Schedule("s3");
        f1.addItem(s3);
        schedules.addSubFolder(f1);
        Folder f2 = new Folder("F2", EntityType.Schedule);
        Schedule s4 = new Schedule("s4");
        f2.addItem(s4);
        schedules.addSubFolder(f2);
        EmailMessage email = new EmailMessage();
        project.getRootFolder(EntityType.EmailMessage).addItem(email);
        assertEquals(Sets.newHashSet(s1, s2, s3, s4),
                        Sets.newHashSet(project.getAllEntitiesOfClass(Schedule.class)));
        assertTrue(project.getAllEntitiesOfClass(Operation.class).isEmpty());
View Full Code Here


                        Sets.newHashSet(project.getAllEntities()));
    }
   
    @Test
    public void testMarkAsDeployDirty() {
        RootFolder schedules = project.getRootFolder(EntityType.Schedule);
        Schedule s1 = new Schedule("s1");
        project.insertEntity(s1, schedules);
        Folder folder = new Folder("Folder", EntityType.Schedule);
        Schedule s2 = new Schedule("s2");
        folder.addItem(s2);
View Full Code Here

        }
    }
   
    @Test
    public void testRefreshItemLookup() {
        RootFolder schedules = project.getRootFolder(EntityType.Schedule);
        Schedule s1 = new Schedule("s1");
        schedules.addItem(s1);
        Folder folder = new Folder("Folder", EntityType.Schedule);
        Schedule s2 = new Schedule("s2");
        folder.addItem(s2);
        schedules.addSubFolder(folder);
        EmailMessage email = new EmailMessage();
        project.getRootFolder(EntityType.EmailMessage).addItem(email);
        project.refreshItemLookup();
        for (IntegrationEntity e : Arrays.asList(s1, s2, folder, email)) {
            assertSame(e, project.getItemLookup().getEntity(e.getID()));
View Full Code Here

        }
    }

    @Test
    public void ensureDeployDirtyItemDetectionWorks() {
        RootFolder schedules = project.getRootFolder(EntityType.Schedule);
        Schedule s1 = new Schedule("s1");
        project.insertEntity(s1, schedules);
        Folder folder = new Folder("Folder", EntityType.Schedule);
        Schedule s2 = new Schedule("s2");
        folder.addItem(s2);
View Full Code Here

        checkOtherRootFolders(partial);
    }
   
    private IntegrationProject createOriginalProject() {
        IntegrationProject project = IntegrationProject.createNewProject(null);
        RootFolder schedules = project.getRootFolder(EntityType.Schedule);
        schedule_1 = new Schedule("s1");
        schedule_2 = new Schedule("s2");
        schedules.addItem(schedule_1);
        schedules.addItem(schedule_2);
        scheduleSubFolder_1 = new Folder("F1", EntityType.Schedule);
        schedule_3 = new Schedule("s3");
        scheduleSubFolder_1.addItem(schedule_3);
        schedules.addSubFolder(scheduleSubFolder_1);
        scheduleSubFolder_2 = new Folder("F2", EntityType.Schedule);
        schedule_4 = new Schedule("s4");
        schedule_5 = new Schedule("s5");
        scheduleSubFolder_2.addItem(schedule_4);
        scheduleSubFolder_2.addItem(schedule_5);
        schedules.addSubFolder(scheduleSubFolder_2);
        email_1 = new EmailMessage();
        project.getRootFolder(EntityType.EmailMessage).addItem(email_1);
        project.setLocationOnDisk(new File("/tmp/"));
        return project;
    }
View Full Code Here

        project.setLocationOnDisk(new File("/tmp/"));
        return project;
    }

    private void checkSchedules(IntegrationProject partial) {
        RootFolder schedules = partial.getRootFolder(EntityType.Schedule);
        Schedule schedule_2_copy = (Schedule) schedules.getDescendant(schedule_2.getID());
        assertEquals(schedule_2, schedule_2_copy);
        assertTrue(schedule_2_copy.getParent() == schedules);
        Folder subFolder_2_copy = (Folder) schedules.getDescendant(scheduleSubFolder_2.getID());
        assertEquals(scheduleSubFolder_2, subFolder_2_copy);
        assertTrue(subFolder_2_copy.getParent() == schedules);
        Schedule schedule_4_copy = (Schedule) schedules.getDescendant(schedule_4.getID());
        assertEquals(schedule_4, schedule_4_copy);
        assertTrue(schedule_4_copy.getParent() == subFolder_2_copy);
        Schedule schedule_3_copy = (Schedule) schedules.getDescendant(schedule_3.getID());
        assertEquals(schedule_3, schedule_3_copy);
        // Since we didn't copy the parent of schedule_3, we expect the corresponding schedule
        // in the partial project to be attached to the RootFolder.
        assertTrue(schedule_3_copy.getParent() == schedules);
        assertEquals(1, schedules.getNumberOfSubFoldersRecursively());
        assertEquals(3, schedules.getNumberOfItemsRecursively());
    }
View Full Code Here

        assertEquals(1, schedules.getNumberOfSubFoldersRecursively());
        assertEquals(3, schedules.getNumberOfItemsRecursively());
    }
   
    private void checkEmails(IntegrationProject partial) {
        RootFolder emails = partial.getRootFolder(EntityType.EmailMessage);
        EmailMessage email_1_copy = (EmailMessage) emails.getDescendant(email_1.getID());
        assertEquals(email_1, email_1_copy);
        assertEquals(0, emails.getNumberOfSubFoldersRecursively());
        assertEquals(1, emails.getNumberOfItemsRecursively());
    }
View Full Code Here

            p.putString(NAME, e.getName());
        }

        private void addItems(IntegrationProject project, Persistor parent, EntityType type) {
            assert type == EntityType.Schedule || type == EntityType.Operation;
            RootFolder rf = project.getRootFolder(type);
            processFolder(parent, rf, type);
        }
View Full Code Here

                throw new RuntimeException(e);
            }
        }

        private void restoreType(IntegrationProject project, EntityType type, Persistor content) {
            RootFolder rf = project.getRootFolder(type);
            populateFolder(rf, content, type);
        }
View Full Code Here

    /**
     * Creates a tree model based on the items of the given type in the given project.
     */
    public static IntegrationEntityTreeModel createTreeModel(IntegrationProject project, EntityType type) {
        ProjectTreeFragmentCreator c = new ProjectTreeFragmentCreator(project);
        RootFolder folder = project.getRootFolder(type);
        KongaTreeNode root = new RootFolderNode(folder);
        c.createFragment(root, type);
        root.sortChildren();
        return new IntegrationEntityTreeModel(root);
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.data.entity.RootFolder

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.