Package hudson.model

Examples of hudson.model.Hudson


            initThread = new Thread("hudson initialization thread") {
                @Override
                public void run() {
                    boolean success = false;
                    try {
                        Jenkins instance = new Hudson(home, context);
                        context.setAttribute(APP, instance);

                        // at this point we are open for business and serving requests normally
                        LOGGER.info("Jenkins is fully up and running");
                        success = true;
                    } catch (Error e) {
                        LOGGER.log(Level.SEVERE, "Failed to initialize Jenkins",e);
                        context.setAttribute(APP,new HudsonFailedToLoad(e));
                        throw e;
                    } catch (Exception e) {
                        LOGGER.log(Level.SEVERE, "Failed to initialize Jenkins",e);
                        context.setAttribute(APP,new HudsonFailedToLoad(e));
                    } finally {
                        Jenkins instance = Jenkins.getInstance();
                        if(!success && instance!=null)
                            instance.cleanUp();
                    }
                }
            };
            initThread.start();
        } catch (Error e) {
View Full Code Here


    protected Hudson newHudson() throws Exception {
        ServletContext webServer = createWebServer();
        File home = homeLoader.allocate();
        for (JenkinsRecipe.Runner r : recipes)
            r.decorateHome(this,home);
        return new Hudson(home, webServer, getPluginManager());
    }
View Full Code Here

*/
public class SeleniumTest extends HudsonTestCase {

    @Override
    protected Hudson newHudson() throws Exception {
        Hudson h = super.newHudson();
        Mailer.descriptor().setHudsonUrl(getURL().toExternalForm());
        return h;
    }
View Full Code Here

public class CrowdMailAddressResolver extends MailAddressResolver {

    @Override
    public String findMailAddressFor(User u) {
        // LDAP not active
        Hudson hudson = Hudson.getInstance();
        if (!(hudson.getSecurityRealm() instanceof CrowdSecurityRealm))
            return null;
        try {
            CrowdUserDetails details = (CrowdUserDetails) hudson.getSecurityRealm()
                    .getSecurityComponents().userDetails.loadUserByUsername(u.getId());
            String mail = details.getEmail();
            if (mail == null)
                return null; // not found
            return mail;
View Full Code Here

  /**
   * @return all available installations, never <tt>null</tt>
   * @since 1.7
   */
  public static final SonarInstallation[] all() {
    Hudson hudson = Hudson.getInstance();
    if (hudson == null) {
      // for unit test
      return new SonarInstallation[0];
    }
    SonarPublisher.DescriptorImpl sonarDescriptor = Hudson.getInstance().getDescriptorByType(SonarPublisher.DescriptorImpl.class);
View Full Code Here

     *
     * @throws Exception if so.
     */
    @Test
    public void testToJson() throws Exception {
        Hudson hudson = MockUtils.mockHudson();
        MockUtils.mockStringMetadataValueDescriptor(hudson);
        String name = "nameTest";
        String description = "descrText";
        String value = "I am the greatest!";
        StringMetadataValue metadataValue = new StringMetadataValue(name, description, value, false);
View Full Code Here

     *
     * @throws Exception if so.
     */
    @Test
    public void testFromJson() throws Exception {
        Hudson hudson = MockUtils.mockHudson();
        MockUtils.mockMetadataValueDescriptors(hudson);
        String name = "nameTest";
        String description = "descrText";
        String value = "Bug Busters!!";
        boolean exposed = true;
View Full Code Here

     *
     * @throws Exception if so.
     */
    @Test
    public void testToJson() throws Exception {
        Hudson hudson = MockUtils.mockHudson();
        MockUtils.mockNumberMetadataValueDescriptor(hudson);
        String name = "nameTest";
        String description = "descrText";
        long value = 5000;
        NumberMetadataValue metadataValue = new NumberMetadataValue(name, description, value, false);
View Full Code Here

     *
     * @throws Exception if so.
     */
    @Test
    public void testFromJson() throws Exception {
        Hudson hudson = MockUtils.mockHudson();
        MockUtils.mockMetadataValueDescriptors(hudson);
        String name = "nameTest";
        String description = "descrText";
        long value = 5432;
        boolean exposed = true;
View Full Code Here

     *
     * @throws Exception if so.
     */
    @Test
    public void testToJson() throws Exception {
        Hudson hudson = MockUtils.mockHudson();
        MockUtils.mockDateMetadataValueDescriptor(hudson);
        String name = "nameTest";
        String description = "descrText";
        Calendar value = Calendar.getInstance();
        DateMetadataValue metadataValue = new DateMetadataValue(name, description, value, false, false);
View Full Code Here

TOP

Related Classes of hudson.model.Hudson

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.