Package org.subethamail.wiser

Examples of org.subethamail.wiser.Wiser


  }

  /** */
  private void startStop(boolean pause) throws Exception
  {
    Wiser wiser = new Wiser();
    wiser.setPort(PORT);

    wiser.start();

    if (pause)
      Thread.sleep(1000);

    wiser.stop();

    this.counter++;
  }
View Full Code Here


  /** */
  @Override
  protected void setUp() throws Exception
  {
    super.setUp();
    this.server = new Wiser();
    this.server.setPort(SMTP_PORT);
    this.server.start();
  }
View Full Code Here

  }

  /** */
  public void testTimeout() throws Exception
  {
    Wiser wiser = new Wiser();
    wiser.setPort(PORT);
    wiser.getServer().setConnectionTimeout(1000);

    wiser.start();

    Socket sock = new Socket(InetAddress.getLocalHost(), PORT);
    OutputStream out = sock.getOutputStream();
    PrintWriter writer = new PrintWriter(new OutputStreamWriter(out));

    writer.print("HELO foo\r\n");
    assert(!writer.checkError());

    Thread.sleep(2000);

    writer.print("HELO bar\r\n");
    assert(writer.checkError());

    wiser.stop();
  }
View Full Code Here

  public static final int PORT = 2566;

  /** */
  public static void main(String[] args) throws Exception
  {
    Wiser wiser = new Wiser();
    wiser.setHostname("localhost");
    wiser.setPort(PORT);

    wiser.start();

    String line;
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

    do
    {
      line = in.readLine();
      line = line.trim();

      if ("dump".equals(line));
        wiser.dumpMessages(System.out);

      if (line.startsWith("dump "))
      {
        line = line.substring("dump ".length());
        File f = new File(line);
        OutputStream out = new FileOutputStream(f);
        wiser.dumpMessages(new PrintStream(out));
        out.close();
      }
    }
    while (!"quit".equals(line));

    wiser.stop();
  }
View Full Code Here

  /** */
  @Override
  protected void setUp() throws Exception
  {
    super.setUp();
    this.server = new Wiser();
    this.server.setPort(SMTP_PORT);
    this.server.start();
    this.socket = new Socket(HOST_NAME, SMTP_PORT);
    this.input = new BufferedReader(new InputStreamReader(this.socket.getInputStream()));
    this.output = new PrintWriter(this.socket.getOutputStream(), true);
View Full Code Here

    protected void setUp() throws Exception {
        ChainedProperties props = new ChainedProperties( "email.conf", ClassLoaderUtil.getClassLoader( null, getClass(), false ));
        emailHost = props.getProperty( "host", "localhost" );
        emailPort = props.getProperty( "port", "2345" );
       
        wiser = new Wiser();
        wiser.setHostname( emailHost );
        wiser.setPort( Integer.parseInt( emailPort ) );
        wiser.start();
    }
View Full Code Here

    protected void setUp() throws Exception {
        ChainedProperties props = new ChainedProperties( "email.conf" );
        emailHost = props.getProperty( "host", "localhost" );
        emailPort = props.getProperty( "port", "2345" );
       
        wiser = new Wiser();
        wiser.setHostname( emailHost );
        wiser.setPort( Integer.parseInt( emailPort ) );
        wiser.start();
    }
View Full Code Here

        SocketAddress address = new InetSocketAddress( "127.0.0.1",
                                                       9123 );
        client.connect( connector,
                        address );

        wiser = new Wiser();
        wiser.setHostname( emailHost );
        wiser.setPort( Integer.parseInt( emailPort ) );        
        wiser.start();
    }
View Full Code Here

        SocketAddress address = new InetSocketAddress( "127.0.0.1",
                                                       9123 );
        client.connect( connector,
                        address );
       
        wiser = new Wiser();
        wiser.setHostname( conf.getProperty( "mail.smtp.host" ) );
        wiser.setPort( Integer.parseInt( conf.getProperty( "mail.smtp.port" ) ) );       
        wiser.start();
    }
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();
   
    boolean serverUpAndRunning = false;
    while (!serverUpAndRunning) {
      wiser = new Wiser();
      wiser.setPort(5025);
     
      try {
        wiser.start();
        serverUpAndRunning = true;
View Full Code Here

TOP

Related Classes of org.subethamail.wiser.Wiser

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.