Package hudson.tasks.Mailer

Examples of hudson.tasks.Mailer.DescriptorImpl


        // this allows tests to use a part of the URL space for itself.
        hudson.getActions().add(this);

        // cause all the descriptors to reload.
        // ideally we'd like to reset them to properly emulate the behavior, but that's not possible.
        DescriptorImpl desc = Mailer.descriptor();
        // prevent NPE with eclipse
        if (desc != null) Mailer.descriptor().setHudsonUrl(null);
        for( Descriptor d : hudson.getExtensionList(Descriptor.class) )
            d.load();
View Full Code Here


    }

    public Mailbox runMailTest(boolean perModuleEamil) throws Exception {

        final DescriptorImpl mailDesc = Jenkins.getInstance().getDescriptorByType(Mailer.DescriptorImpl.class);

        // intentionally give the whole thin in a double quote
        Mailer.descriptor().setAdminAddress("\"me <me@sun.com>\"");

        String recipient = "you <you@sun.com>";
View Full Code Here

        assertNotSame(before,after);
        assertEqualBeans(before,after,"recipients,dontNotifyEveryUnstableBuild,sendToIndividuals");
    }

    public void testGlobalConfigRoundtrip() throws Exception {
        DescriptorImpl d = Mailer.descriptor();
        d.setAdminAddress("admin@me");
        d.setDefaultSuffix("default-suffix");
        d.setHudsonUrl("http://nowhere/");
        d.setSmtpHost("smtp.host");
        d.setSmtpPort("1025");
        d.setUseSsl(true);
        d.setSmtpAuth("user","pass");

        submit(new WebClient().goTo("configure").getFormByName("config"));

        assertEquals("admin@me",d.getAdminAddress());
        assertEquals("default-suffix",d.getDefaultSuffix());
        assertEquals("http://nowhere/",d.getUrl());
        assertEquals("smtp.host",d.getSmtpServer());
        assertEquals("1025",d.getSmtpPort());
        assertEquals(true,d.getUseSsl());
        assertEquals("user",d.getSmtpAuthUserName());
        assertEquals("pass",d.getSmtpAuthPassword());

        d.setUseSsl(false);
        d.setSmtpAuth(null,null);
        submit(new WebClient().goTo("configure").getFormByName("config"));
        assertEquals(false,d.getUseSsl());
        assertNull("expected null, got: " + d.getSmtpAuthUserName(), d.getSmtpAuthUserName());
        assertNull("expected null, got: " + d.getSmtpAuthPassword(), d.getSmtpAuthPassword());
    }
View Full Code Here

TOP

Related Classes of hudson.tasks.Mailer.DescriptorImpl

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.