Package org.jasig.portal.concurrency

Examples of org.jasig.portal.concurrency.CallableWithoutResult


        verifyGetEvents(Collections.<PortalEvent>emptyList(), startDate, endDate);
        verifyAggregateEvents(Collections.<PortalEvent>emptyList(), startDate, endDate);
    }

    protected void verifyGetEvents(final List<PortalEvent> originalEvents, final DateTime startDate, final DateTime endDate) {
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                //Get all events
                final List<PortalEvent> portalEvents = new LinkedList<PortalEvent>();
                portalEventDao.getPortalEvents(startDate, endDate, new FunctionWithoutResult<PortalEvent>() {
View Full Code Here


            }
        });
    }

    protected void verifyAggregateEvents(final List<PortalEvent> originalEvents, final DateTime startDate, final DateTime endDate) {
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                //Get all events
                final List<PortalEvent> portalEvents = new LinkedList<PortalEvent>();
               
View Full Code Here

            }
        });
    }
    
    protected void deleteEvents(final List<PortalEvent> originalEvents, final DateTime startDate, final DateTime endDate) {
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
               
                //Delete the events
                portalEventDao.deletePortalEventsBefore(endDate);
View Full Code Here

                  failedFutures.addAll(newFailed);
                 
                  final AtomicLong importTime = new AtomicLong(-1);
                 
                  //Create import task
                  final Callable<Object> task = new CallableWithoutResult() {
                        @Override
                        protected void callWithoutResult() {
                        IMPORT_BASE_DIR.set(directoryUriStr);
                        importTime.set(System.nanoTime());
                          try {
View Full Code Here

                  failedFutures.addAll(newFailed);
                 
                  final AtomicLong exportTime = new AtomicLong(-1);
                 
                  //Create export task
                  Callable<Object> task = new CallableWithoutResult() {
                        @Override
                        protected void callWithoutResult() {
                            exportTime.set(System.nanoTime());
                            try {
                                exportData(typeId, dataId, typeDir);
View Full Code Here

    @Test
    public void testVersionLifecycle() {
        final String productName = "TEST_VERSION";
       
        //Doesn't exist
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final Version version = versionDao.getVersion(productName);
                assertNull(version);
            }
        });

        //Create
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                Version version = versionDao.getVersion(productName);
                assertNull(version);
                version = versionDao.setVersion(productName, 1, 2, 3, null);
                assertNotNull(version);
                assertEquals(1, version.getMajor());
                assertEquals(2, version.getMinor());
                assertEquals(3, version.getPatch());
                assertNull(version.getLocal());
            }
        });

        //Update
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                Version version = versionDao.getVersion(productName);
                assertNotNull(version);
                assertEquals(1, version.getMajor());
                assertEquals(2, version.getMinor());
                assertEquals(3, version.getPatch());
                assertNull(version.getLocal());
               

                version = versionDao.setVersion(productName, 4, 5, 6, null);
                assertNotNull(version);
                assertEquals(4, version.getMajor());
                assertEquals(5, version.getMinor());
                assertEquals(6, version.getPatch());
                assertNull(version.getLocal());
            }
        });

        //verify
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                Version version = versionDao.getVersion(productName);
                assertNotNull(version);
                assertEquals(4, version.getMajor());
View Full Code Here

    @Test
    public void testVersionBadSql() {
        final String productName = "TEST_VERSION";
       
        //Create
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                Version version = versionDao.getVersion(productName);
                assertNull(version);
                version = versionDao.setVersion(productName, 1, 2, 3, null);
                assertNotNull(version);
                assertEquals(1, version.getMajor());
                assertEquals(2, version.getMinor());
                assertEquals(3, version.getPatch());
                assertNull(version.getLocal());
            }
        });
       
        jdbcOperations.execute("ALTER TABLE UP_VERSION DROP LOCAL_VER");
        try {
            //Doesn't exist
            this.execute(new CallableWithoutResult() {
                @Override
                protected void callWithoutResult() {
                    final Version version = versionDao.getVersion(productName);
                    assertNotNull(version);
                    assertEquals(1, version.getMajor());
View Full Code Here

TOP

Related Classes of org.jasig.portal.concurrency.CallableWithoutResult

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.