Package org.teiid.services

Examples of org.teiid.services.BufferServiceImpl


@SuppressWarnings("nls")
public class TestLocalBufferService {

    @Test public void testCheckMemPropertyGotSet() throws Exception {
        BufferServiceImpl svc = new BufferServiceImpl();
        svc.setDiskDirectory(UnitTestUtil.getTestScratchPath()+"/teiid/1");
        svc.setUseDisk(true);
       
        svc.start();
        // all the properties are set
        assertTrue("Not Directory", svc.getBufferDirectory().isDirectory()); //$NON-NLS-1$
        assertTrue("does not exist", svc.getBufferDirectory().exists()); //$NON-NLS-1$
        assertTrue("does not end with one", svc.getBufferDirectory().getParent().endsWith("1")); //$NON-NLS-1$ //$NON-NLS-2$
        assertTrue(svc.isUseDisk());
       
        BufferManagerImpl mgr = (BufferManagerImpl) svc.getBufferManager();
        assertTrue(((FileStorageManager)mgr.getStorageManager()).getDirectory().endsWith(svc.getBufferDirectory().getName()));
    }
View Full Code Here


        BufferManagerImpl mgr = (BufferManagerImpl) svc.getBufferManager();
        assertTrue(((FileStorageManager)mgr.getStorageManager()).getDirectory().endsWith(svc.getBufferDirectory().getName()));
    }

    @Test public void testCheckMemPropertyGotSet2() throws Exception {
        BufferServiceImpl svc = new BufferServiceImpl();
        svc.setDiskDirectory(UnitTestUtil.getTestScratchPath()+"/teiid/1");
        svc.setUseDisk(false);
        svc.start();
       
        // all the properties are set
        assertFalse(svc.isUseDisk());
    }
View Full Code Here

      schema.add(new Constant(null, DataTypeManager.DefaultDataClasses.SHORT));
      for (int i = 0; i <20; i++) {
        schema.add(new Constant(null, DataTypeManager.DefaultDataClasses.BIG_DECIMAL));
      }
     
      BufferServiceImpl svc = new BufferServiceImpl();
        svc.setDiskDirectory(UnitTestUtil.getTestScratchPath()+"/teiid/1");
        svc.setUseDisk(false);
        svc.start();
       
        BufferManager mgr = svc.getBufferManager();
        assertEquals(16261, mgr.getSchemaSize(schema));
    }
View Full Code Here

TOP

Related Classes of org.teiid.services.BufferServiceImpl

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.