Package org.pentaho.platform.plugin.services.email

Examples of org.pentaho.platform.plugin.services.email.EmailConfiguration


  @Path( "/resetEmailConfig" )
  @Produces( { MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON } )
  public Response deleteEmailConfig( EmailConfiguration emailConfiguration ) {
    if ( canAdminister() ) {
      try {
        emailService.setEmailConfig( new EmailConfiguration() );
        return Response.ok().build();
      } catch ( Exception e ) {
        return Response.serverError().build();
      }
    } else {
View Full Code Here


  public IEmailConfiguration getEmailConfig() {
    if ( canAdminister() ) {
      try {
        return emailService.getEmailConfig();
      } catch ( Exception e ) {
        return new EmailConfiguration();
      }
    } else {
      return new EmailConfiguration();
    }
  }
View Full Code Here

    }

    IEmailConfiguration emptyConfig = emailResource.getEmailConfig();
    assertTrue( BLANK_CONFIG.equals( emptyConfig ) );

    Response response = emailResource.setEmailConfig( new EmailConfiguration() );
    assertEquals( OK_STATUS, response.getStatus() );
    emptyConfig = emailResource.getEmailConfig();
    assertTrue( BLANK_CONFIG.equals( emptyConfig ) );

    final EmailConfiguration emailConfigOriginal =
        new EmailConfiguration( true, false, "test@pentaho.com", "Pentaho Scheduler", null, 36,
            "", true, "user", null, false, true );
    response = emailResource.setEmailConfig( emailConfigOriginal );
    assertEquals( OK_STATUS, response.getStatus() );

    final IEmailConfiguration emailConfigNew = emailResource.getEmailConfig();
    assertTrue( emailConfigOriginal.equals( emailConfigNew ) );

  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.plugin.services.email.EmailConfiguration

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.