Package org.apache.james.services

Examples of org.apache.james.services.MockFileSystem


        m_dnsServer = new AlterableDNSServer();
        m_serviceManager.put("dnsservice", m_dnsServer);

        store = new MockMailStore();
        m_serviceManager.put("mailStore", store);
        fileSystem = new MockFileSystem();

        m_serviceManager.put("filesystem", fileSystem);
        m_serviceManager.put("org.apache.james.smtpserver.protocol.DNSService", dnsAdapter);
        m_serviceManager.put("virtualusertable", new VirtualUserTable() {
View Full Code Here


    serviceManager.put("usersstore", usersStore);

    mailServer = new MockMailServer();
    serviceManager.put("mailserver", mailServer);
   
    filesystem = new MockFileSystem();
    serviceManager.put("filesystem", filesystem);


    dnsservice = setUpDNSServer();
    serviceManager.put("dnsservice", dnsservice);
View Full Code Here

     * @throws ServiceException
     * @throws ConfigurationException
     * @throws Exception
     */
    protected MailRepository getMailRepository() throws Exception {
        MockFileSystem fs =  new MockFileSystem();
        DataSource datasource = TestUtil.getDataSource();
        JDBCMailRepository mr = new JDBCMailRepository();
       
        // only used for dbfile
        MockMailStore mockStore = new MockMailStore();
View Full Code Here

       
        serviceManager.put("mailboxmanager", manager);
       
        dnsservice = setUpDNSServer();
        serviceManager.put("dnsservice", setUpDNSServer());
        fSystem = new MockFileSystem();
        serviceManager.put("filesystem",fSystem);
     
    }
View Full Code Here

        m_dnsServer = new AlterableDNSServer();
        m_serviceManager.put("dnsservice", m_dnsServer);

        store = new MockMailStore();
        m_serviceManager.put("mailStore", store);
        fileSystem = new MockFileSystem();

        m_serviceManager.put("filesystem", fileSystem);
        m_serviceManager.put("org.apache.james.smtpserver.protocol.DNSService", dnsAdapter);
        m_serviceManager.put("virtualusertable", new VirtualUserTable() {
View Full Code Here

    public void testAddRemoveGetDomains() throws Exception {
       
   
        JDBCDomainList dom = new JDBCDomainList();
        dom.setDNSService(setUpDNSServer("localhost"));
        dom.setFileSystem(new MockFileSystem());
        dom.setDataSource(data);
        dom.setLog(new SimpleLog("MockLog"));
        dom.configure(setUpConfiguration(repos + table));
        dom.init();
        dom.addDomain("domain1.");
View Full Code Here

    public void testThrowConfigurationException() throws Exception {
        boolean exception = false;
        JDBCDomainList dom = new JDBCDomainList();
        dom.setDNSService(setUpDNSServer("localhost"));
        dom.setFileSystem(new MockFileSystem());
        dom.setDataSource(data);
        dom.setLog(new SimpleLog("MockLog"));
        dom.configure(new DefaultConfigurationBuilder());
        try {
            dom.init();
View Full Code Here

     * @throws ServiceException
     * @throws ConfigurationException
     * @throws Exception
     */
    protected MailRepository getMailRepository() throws Exception {
        MockFileSystem fs =  new MockFileSystem();
        FileMailRepository mr = new FileMailRepository();
        MockMailStore mockStore = new MockMailStore();
        FilePersistentStreamRepository file_Persistent_Stream_Repository = new FilePersistentStreamRepository();
        file_Persistent_Stream_Repository.setFileSystem(fs);
        file_Persistent_Stream_Repository.setLog(new SimpleLog("MockLog"));
View Full Code Here

    protected MailRepository getMailRepository() throws  Exception {
        MBoxMailRepository mr = new MBoxMailRepository();

        DefaultConfigurationBuilder defaultConfiguration = new DefaultConfigurationBuilder();
       
        File fInbox = new MockFileSystem().getFile("file://conf/org/apache/james/mailrepository/testdata/Inbox");
        String mboxPath = "mbox://"+fInbox.toURI().toString().substring(new File("").toURI().toString().length());
       
        defaultConfiguration.addProperty("[@destinationURL]",mboxPath);
        defaultConfiguration.addProperty("[@type]","MAIL");
        mr.setLog(new SimpleLog("MockLog"));;
View Full Code Here

     */
    protected AbstractVirtualUserTable getVirtualUserTable() throws Exception {
        JDBCVirtualUserTable virtualUserTable = new JDBCVirtualUserTable();
        virtualUserTable.setLog(new SimpleLog("MockLog"));
        virtualUserTable.setDataSource(TestUtil.getDataSource());
        virtualUserTable.setFileSystem(new MockFileSystem());
        DefaultConfigurationBuilder defaultConfiguration = new DefaultConfigurationBuilder();
        defaultConfiguration.addProperty("[@destinationURL]","db://maildb/VirtualUserTable");
        defaultConfiguration.addProperty("sqlFile","file://conf/sqlResources.xml");
        virtualUserTable.configure(defaultConfiguration);
        virtualUserTable.init();
View Full Code Here

TOP

Related Classes of org.apache.james.services.MockFileSystem

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.