You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by hb...@apache.org on 2002/10/12 21:35:18 UTC

cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

hbedi       2002/10/12 12:35:18

  Added:       src/java/org/apache/james/testing BaseTest.java Main.java
                        POP3Test.java TestMethod.java runtest.bat
                        runtest.sh testconf.xml
  Log:
  test suite and pop3 test.
  
  Revision  Changes    Path
  1.1                  jakarta-james/src/java/org/apache/james/testing/BaseTest.java
  
  Index: BaseTest.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.james.testing;
  
  import junit.framework.TestCase;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  
  /**
   * Base Test class. Can run a set of tests.
   */
  public class BaseTest extends TestCase implements Configurable {
  
      private TestMethod[] testMethod;
      private boolean showStat;
  
      public BaseTest(String name) {
          super(name);
      }
  
      public void configure(Configuration configuration) 
          throws ConfigurationException 
      {
          // list of test methods
          Configuration testseq = configuration.getChild("testsequence");
          showStat = testseq.getAttributeAsBoolean("showStat");
          Configuration[] testconf = testseq.getChildren("testmethod");
          testMethod = new TestMethod[testconf.length];
          for ( int i = 0 ; i < testMethod.length ; i++ )
              testMethod[i] = new TestMethod(testconf[i].getValue());
      }
  
      public final int countTestCases() {
          return testMethod.length;
      }
  
      protected final void runTest() throws Throwable {
          for ( int i = 0 ; i < testMethod.length ; i++ ) {
              testMethod[i].invoke(this);
              if ( showStat )
                  System.out.println("stat: "+getName()+", "+testMethod[i]);
          }
      }
  }
  
  
  
  1.1                  jakarta-james/src/java/org/apache/james/testing/Main.java
  
  Index: Main.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.james.testing;
  
  import junit.framework.*;
  import junit.extensions.*;
  import junit.textui.*;
  import java.io.*;
  import org.apache.avalon.framework.configuration.*;
  import java.lang.reflect.*;
  
  /**
   * Run tests. 
   * - Reads test configuration file, constructs test suite
   * - initiates tests, reports result.
   */
  public class Main {
      public static void main(String[] args) throws Exception {
          System.out.println("Usage java org.apache.james.testing.Main <testconfigfile>");
  
          File testconfFile = new File(args[0]);
          DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
          Configuration alltestconf = builder.buildFromFile(testconfFile);
          Configuration[] testconf = alltestconf.getChildren("test");
          TestSuite alltests = new TestSuite();
          for ( int i = 0 ; i < testconf.length ; i++ ) {
              Configuration conf = testconf[i];
              String clsname = conf.getAttribute("class");
              String name = conf.getAttribute("name");
              int repetition = conf.getAttributeAsInteger("repetition");
              boolean async = conf.getAttributeAsBoolean("async");
  
              Class clazz = Class.forName(clsname);
              Constructor cstr = clazz.getConstructor(new Class[] { String.class });
              Test test = (Test)cstr.newInstance(new Object[] {name});
              if ( test instanceof Configurable )
                  ((Configurable)test).configure(conf);
  
              if (repetition > 1)
                  test = new RepeatedTest(test,repetition);
  
              if ( async ) {
                  TestSuite ts = new ActiveTestSuite();
                  ts.addTest(test);
                  test = ts;
              }
              alltests.addTest(test);
          }
          TestRunner.run(alltests);
      }
  }
  
  
  
  1.1                  jakarta-james/src/java/org/apache/james/testing/POP3Test.java
  
  Index: POP3Test.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.james.testing;
  
  import java.io.InputStream;
  import java.io.FileOutputStream;
  import java.io.OutputStream;
  import javax.mail.internet.MimeMessage;
  import org.apache.avalon.excalibur.io.IOUtil;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.commons.net.SocketClient;
  import org.apache.commons.net.pop3.POP3;
  import org.apache.commons.net.pop3.POP3Client;
  import org.apache.commons.net.pop3.POP3MessageInfo;
  import org.apache.james.fetchpop.ReaderInputStream;
  
  /**
   * Fetch mail. Can be configured and extended to test specific pop3
   * operations.
   */
  public class POP3Test extends BaseTest {
      private String host, username, password;
  
      public POP3Test(String name) {
          super(name);
      }
  
      public void configure(Configuration configuration) 
          throws ConfigurationException 
      {
          this.host = configuration.getChild("host").getValue();
          this.username = configuration.getChild("username").getValue();
          this.password = configuration.getChild("password").getValue();
          super.configure(configuration);
      }
  
      private POP3Client client;
  
      protected void setUp() throws Exception {
          client = new POP3Client();
          client.connect(host);
      }
  
      protected void tearDown() throws Exception {
          client.disconnect();
      }
  
      // ----------- pop3 operations ------------
  
      private POP3MessageInfo[] msg;
      private static int saveMsgCounter;
  
      public void login() throws Exception {
          client.login(username, password);
      }
      public void logout() throws Exception {
          client.logout();
      }
      public void fetchMsgsInfo() throws Exception {
          msg = client.listMessages();
      }
  
      public void fetchMsgs() throws Exception {
          for ( int i = 0 ; i < msg.length ; i++ )
              fetchMsg(msg[i],false);
      }
  
      public void fetchAndSaveMsgs() throws Exception {
          for ( int i = 0 ; i < msg.length ; i++ )
              fetchMsg(msg[i],true);
      }
  
      public void deleteMsgs() throws Exception {
          for ( int i = 0 ; i < msg.length ; i++ )
              client.deleteMessage(msg[i].number);
      }
  
      private void fetchMsg(POP3MessageInfo msg,boolean save) throws Exception {
          InputStream in = new ReaderInputStream(client.retrieveMessage(msg.number));
          try {
              MimeMessage message = new MimeMessage(null, in);
              if ( save ) {
                  OutputStream out = new FileOutputStream
                      ("pop3test-"+host+"-"+username+"."+(saveMsgCounter++)+".eml");
                  try {
                      message.writeTo(out);
                  } finally {
                      IOUtil.shutdownStream(out);
                  }
              }
          } finally {
              IOUtil.shutdownStream(in);
          }
      }
  }
  
  
  
  1.1                  jakarta-james/src/java/org/apache/james/testing/TestMethod.java
  
  Index: TestMethod.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.james.testing;
  
  import java.lang.reflect.Method;
  
  class TestMethod {
      // stats
      private int timeTaken;
      private int attempts;
      private int success;
      
      final String name;
      TestMethod(String name) {
          this.name = name;
      }
      
      // invoke test
      void invoke(Object obj) throws Exception {
          Method m = obj.getClass().getMethod(name,new Class[0]);
          attempts++;
          long st = System.currentTimeMillis();
          try {
              m.invoke(obj,new Object[0]);
              success++;
          } finally {
              timeTaken = (int)(System.currentTimeMillis() - st);
          }
      }
      // print report.
      public String toString() {
          return name+", "+timeTaken+", "+success+", "+attempts;
      }
  }
  
  
  
  1.1                  jakarta-james/src/java/org/apache/james/testing/runtest.bat
  
  Index: runtest.bat
  ===================================================================
  echo 'runs james test suite and outputs result in csv file format'
  echo 'test, method, time taken, successful invocations, invocation attempt'
  java org.apache.james.testing.Main testconf.xml | grep "stat: " | sed "s/.*stat: //g"
  
  
  1.1                  jakarta-james/src/java/org/apache/james/testing/runtest.sh
  
  Index: runtest.sh
  ===================================================================
  echo 'runs james test suite and outputs result in csv file format'
  echo 'test, method, time taken, successful invocations, invocation attempt'
  java org.apache.james.testing.Main testconf.xml | grep "stat: " | sed "s/.*stat: //g"
  
  
  
  1.1                  jakarta-james/src/java/org/apache/james/testing/testconf.xml
  
  Index: testconf.xml
  ===================================================================
  <!-- test configuration file -->
  <testsuite>
  <test name="pop3test" async="true" repetition="5" class="org.apache.james.testing.POP3Test">
    <host>localhost</host>
    <username>harmeet</username>
    <password>harmeet</password>
  
    <!-- call these test methods -->
    <testsequence showStat="true">
      <testmethod>login</testmethod>
      <testmethod>fetchMsgsInfo</testmethod>
      <testmethod>fetchMsgs</testmethod>
      <testmethod>logout</testmethod>
    </testsequence>
  </test>
  <test name="pop3test" async="true" repetition="5" class="org.apache.james.testing.POP3Test">
    <host>localhost</host>
    <username>user1</username>
    <password>user1</password>
  
    <!-- call these test methods -->
    <testsequence showStat="true">
      <testmethod>login</testmethod>
      <testmethod>fetchMsgsInfo</testmethod>
      <testmethod>fetchMsgs</testmethod>
      <testmethod>logout</testmethod>
    </testsequence>
  </test>
  <test name="pop3test" async="true" repetition="5" class="org.apache.james.testing.POP3Test">
    <host>localhost</host>
    <username>user2</username>
    <password>user2</password>
  
    <!-- call these test methods -->
    <testsequence showStat="true">
      <testmethod>login</testmethod>
      <testmethod>fetchMsgsInfo</testmethod>
      <testmethod>fetchMsgs</testmethod>
      <testmethod>logout</testmethod>
    </testsequence>
  </test>
  <test name="pop3test" async="true" repetition="5" class="org.apache.james.testing.POP3Test">
    <host>localhost</host>
    <username>user3</username>
    <password>user3</password>
  
    <!-- call these test methods -->
    <testsequence showStat="true">
      <testmethod>login</testmethod>
      <testmethod>fetchMsgsInfo</testmethod>
      <testmethod>fetchMsgs</testmethod>
      <testmethod>logout</testmethod>
    </testsequence>
  </test>
  <test name="pop3test" async="true" repetition="5" class="org.apache.james.testing.POP3Test">
    <host>localhost</host>
    <username>user4</username>
    <password>user4</password>
  
    <!-- call these test methods -->
    <testsequence showStat="true">
      <testmethod>login</testmethod>
      <testmethod>fetchMsgsInfo</testmethod>
      <testmethod>fetchMsgs</testmethod>
      <testmethod>logout</testmethod>
    </testsequence>
  </test>
  </testsuite>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Serge Knystautas <se...@lokitech.com>.
Harmeet Bedi wrote:
> ----- Original Message -----
> From: "Serge Knystautas" <se...@lokitech.com>
> In the past there was talk about creating templates and running those
> templates as a record and replay mechanism. I was wondering what everyone
> thought of that.

If the template idea is what I think it is, I prefer that approach to 
using client libraries (like javamail or other such) because they will 
have rather well behaved, strict behaviors.  I'd really like to make 
sure we can handle numerous kinds of real-world traffic since RFC vs. 
real world is very different for SMTP.  Also would be great to then have 
good documentation about what and how the standards are supported, so 
other mail vendors can now how to work with James.  I'm sure with some 
analysis of real server logs we could build standard smtp, pop3, imap, 
nntp, etc... traffic scripts.

Also I'd like to eventually get to component-level testing... from the 
very basics like a list of 20 or 100 or however many email addresses to 
make sure our address parsing is handling them correctly.  Also higher 
levels like the file and dbfile and db mail & spool repositories, so we 
can really throttle the heck out of those independent of the rest of the 
James code and make sure they're reliable.

Anyway, great to see progress on the testing front.

-- 
Serge Knystautas
Loki Technologies
http://www.lokitech.com/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tests (was RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml)

Posted by Harmeet Bedi <ha...@kodemuse.com>.
From: "Serge Knystautas" <se...@lokitech.com>
> I'm sure with some
> analysis of real server logs we could build standard smtp, pop3, imap,
> nntp, etc... traffic scripts.

Emacs has a protocol debug flag that should help collect complete protocol
traces. I was output from there to feed templates

----- Original Message -----
From: "Danny Angus" <da...@apache.org>
I'd like to see a mechanism that'd allow us to create emails as plain text
files, or complete SMTP conversations, so that we could quickly create test
cases to check handling of specific protocol related issues, for instance
some of the less common mail address syntax like quoted local parts, and
mail types like read-receipts.



You can do something like this now by going to tests/src/conf directory and
doing
$ java org.apache.james.testing.ProtocolSimulator localhost 25
smtp.protocolsession


Harmeet


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tests (was RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml)

Posted by Harmeet Bedi <ha...@kodemuse.com>.
Added a ProtocolSimulator. Here is a description

 * Simulates protocol sessions. Connects to a protocol server. Test
 * reads template and sends data or reads data from server and
 * validates against given template file.
 *
 * Template rules are:
 *   - All lines starting with '#' are regarded as comments.
 *   - All template lines start with 'C: ' or 'S: '
 *   - Each template line is treated as a seprate unit.
 *   - 'C: ' indicates client side communication that is communication
 *     from this test to remote server.
 *   - 'S: ' indicates server response.
 *   - Client side communication is obtained from template file and is
 *     sent as is to the server.
 *   - Expected Server side responses are read from template. Expected
 *     Server side response is matched against actual server response
 *     using perl regular expressions.
 *
 * Example POP3 prototol script to test for authentication:
 *   # note \ before '+'. '+' needs to be escaped
 *   S: \+OK.*
 *   C: USER test
 *   S: \+OK.*
 *   C: PASS invalidpwd
 *   S: -ERR.*
 *   C: USER test
 *   S: \+OK.*
 *   C: PASS test
 *   S: \+OK.*


Usage is
java org.apache.tools.testing.ProtocolSimulator <host> <port> <template>

Please take a look at it. I think it can be used to test protocol
interactions effectively. Thought a bit about general template engines, but
this seemed to provide max gain, with reasonable effort.

Comments....
Harmeet


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Tests (was RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml)

Posted by Danny Angus <da...@apache.org>.
> I was thinking a short sanity test
> suite, a longer regression test suite and a set of tests that mimick
> specific problems like memory leak or crash would be good.

I'm aiming to develop EndToEnd into a pre-release functionality testsuite, running a series of transactions to confirm that the basic functionality of a build is working, executing this test as part of the "build everything" task will ensure that releases are only made when James is working.

> 
> In the past there was talk about creating templates and running those
> templates as a record and replay mechanism. I was wondering what everyone
> thought of that.

I'd like to see a mechanism that'd allow us to create emails as plain text files, or complete SMTP conversations, so that we could quickly create test cases to check handling of specific protocol related issues, for instance some of the less common mail address syntax like quoted local parts, and mail types like read-receipts.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Harmeet Bedi <ha...@kodemuse.com>.
----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: "James Developers List" <ja...@jakarta.apache.org>
Sent: Wednesday, October 16, 2002 7:34 AM
Subject: Re: cvs commit: jakarta-james/src/java/org/apache/james/testing
BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh
testconf.xml


> Nevermind... you guys got a lot done this weekend and are ahead of me on
> this.  Sounds great.
>

Hey Serge welcome back. :-)

> > Each of us should
> be
> > able to run a script that does a clean build to make sure what we check
> into
> > CVS doesn't break anything.  I know it's the ideal and we're a long way
> from
> > that, but the code could really use it.

I think we are getting there. Danny's EndToEnd test integrated with build
environment gives lot of good feedback. I am planning to add some tests and
integrate with build as soon as I can. I was thinking a short sanity test
suite, a longer regression test suite and a set of tests that mimick
specific problems like memory leak or crash would be good.

In the past there was talk about creating templates and running those
templates as a record and replay mechanism. I was wondering what everyone
thought of that.

Harmeet


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Nevermind... you guys got a lot done this weekend and are ahead of me on
> this.  Sounds great.

No ... DANNY got a lot done, and deserves the credit.  :-)

	--- Noel

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Serge Knystautas <se...@lokitech.com>.
Nevermind... you guys got a lot done this weekend and are ahead of me on
this.  Sounds great.

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/
----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: "James Developers List" <ja...@jakarta.apache.org>
Sent: Wednesday, October 16, 2002 10:08 AM
Subject: Re: cvs commit: jakarta-james/src/java/org/apache/james/testing
BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh
testconf.xml


> Man, I go on vacation for 6 days and you guys send me like 500 emails on
> james-dev. :)
>
> I agree with Harmeet that more testing is better, and I agree with Peter
> that this isn't the place for it.
>
> I would +1 adding the testing code immediately where Harmeet left it and
> +++1 a task for someone to build a series testing architecture, and in
doing
> that move this code to that separate directory and build task.
>
> I propose we build a separate directory (test/ next to src/) that holds
> JUnit and other tests that can verify individual components, the entire
> application, the default conf file, and whatever else.  Each of us should
be
> able to run a script that does a clean build to make sure what we check
into
> CVS doesn't break anything.  I know it's the ideal and we're a long way
from
> that, but the code could really use it.  I would recommend creating this
in
> a separate directory rather than branch or tree (since we want to keep
this
> in CVS tree) and not in the proposals directory since testing should be
core
> and always available.
>
> Serge Knystautas
> Loki Technologies - Unstoppable Websites
> http://www.lokitech.com/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Danny Angus <da...@apache.org>.
> I would +1 adding the testing code immediately where Harmeet left it and
> +++1 a task for someone to build a series testing architecture, 
> and in doing
> that move this code to that separate directory and build task.

Hey Serge, welcome back ;-)
There is now a jakarta-james/tests directory and a build.xml in there for exactly this purpose..
eventually the tests should be available as a seperate build & distribution, so users can do their own benchmarking
d.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Serge Knystautas <se...@lokitech.com>.
Man, I go on vacation for 6 days and you guys send me like 500 emails on
james-dev. :)

I agree with Harmeet that more testing is better, and I agree with Peter
that this isn't the place for it.

I would +1 adding the testing code immediately where Harmeet left it and
+++1 a task for someone to build a series testing architecture, and in doing
that move this code to that separate directory and build task.

I propose we build a separate directory (test/ next to src/) that holds
JUnit and other tests that can verify individual components, the entire
application, the default conf file, and whatever else.  Each of us should be
able to run a script that does a clean build to make sure what we check into
CVS doesn't break anything.  I know it's the ideal and we're a long way from
that, but the code could really use it.  I would recommend creating this in
a separate directory rather than branch or tree (since we want to keep this
in CVS tree) and not in the proposals directory since testing should be core
and always available.

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/
----- Original Message -----
From: "Harmeet Bedi" <ha...@kodemuse.com>
To: "James Developers List" <ja...@jakarta.apache.org>;
<fa...@alum.mit.edu>
Sent: Saturday, October 12, 2002 7:27 PM
Subject: Re: cvs commit: jakarta-james/src/java/org/apache/james/testing
BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh
testconf.xml


> From: "Peter M. Goldstein" <pe...@yahoo.com>
> > Please delete and move the code to a more appropriate set of
> > directories.
>
> Can you suggest where ?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [PATCH] Removing Scheduler dependency, refactoring service code

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Let us get more tests first and then do refactor.

I disagree.  There has been a lot of work contributed by a various folks.
The proposed changes were proposed BECAUSE of VERIFIED AND TESTED problems.
The problems surfaced months ago, and surfaced again last week.  The impact
is felt by users, and verified by Danny, who can crash James by overloading
it within minutes.  Andrei found this problem months ago, and proposed the
changes.  It took time to whip those changes into shape, accounting for
changes in Avalon code.  Now Peter has them ready for review, testing, and
deployment.

> If these bugs can be resolved without restructuring code, you should check
> them in.

> If you need to re-architect or re-factor for these fixes, you should post
your
> proposal and your fixes.

I really don't consider these changes to be architecturally significant.
They are a pretty straightforward class re-factoring.  The ARCHITECTURE is
still the same.

I'm glad that you're taking time to be active again, Harmeet, but it seems
that you do have some items to catch up on.  Peter has been a most active
contributor here since mid-summer.  Probably 90% of the commits since he
received Committer status were done by him.  He's read through most of the
James code base.  He's participating on the Avalon developers list.  He's
tested, integrated, etc., (which is good since other Committers have been
busy with their other commitments).  I think that he's earned trust and
respect.

So because I already understand these changes, and I don't see a problem
with them, I really don't want to see them held up without a clearly
explained reason.  You asked for a few days to review the changes, but I
still haven't heard what you think is wrong with them.  What I seem to hear
is that you don't understand what was wrong with the old code.  Maybe I am
just missing it.  Do you have any concrete problems with the changes, or you
just don't understand why it is necessary to change?

> Testing is really important and should be encouraged as much as possible
> rather than building new hoops for it.

Testing is VERY important.  But as a number of people have noted, real world
traffic can crash James.  These fixes correct that problem.  So I don't see
the need to wait for yet another test before we can move forward, unless
there is a REASON.

I'm interested in seeing that SMTP and POP3 work properly, and this set of
long awaited server and handler changes addresses documented issues, doesn't
change the architecture, and is a straightforward re-factoring.  It is vital
to test it to make sure that it works, but that is true of any change.

I hope that your reaction isn't preconditioned because you don't like other
changes that Peter made to the NNTP code.  Perhaps Peter would have been
better off if he had first done the service changes, and after those were in
place, worked on NNTP.  Personally, I had suggested that NNTP be deprecated
it into proposals/ until it was fixed, but Peter felt that it was important
for NNTP to work, so he took the time to do what no one else did this year,
and has been working on it.

Danny and I have had disagreements on API, but this is the first discussion
I've seen since joining the list where it sounded to me that it bordered on
getting personal.  I hope that we can dismiss that issue, and focus on the
code.  James needs all of the developers it can get, and we certainly don't
need developers leaving out of frustration.  As with many Open Source
projects, it is hard enough getting people with the time, interest and
energy to contribute.  That is one of the reasons why Peter wanted to get
NNTP and IMAP working.  He feels that the better the base, the easier it
will be to attract more helpers.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Harmeet Bedi <ha...@kodemuse.com>.
From: "Peter M. Goldstein" <pe...@yahoo.com>
> Please delete and move the code to a more appropriate set of
> directories.

Can you suggest where ?

> This is test code and thus shouldn't be wrapped up with the production
> deliverable.

Test code has been a part of src and shipped with production for many years
in James.. Why the sudden shift ?

Let us get more tests first and then do refactor.

Harmeet
----- Original Message -----
From: "Peter M. Goldstein" <pe...@yahoo.com>
To: "'James Developers List'" <ja...@jakarta.apache.org>
Sent: Saturday, October 12, 2002 1:05 PM
Subject: RE: cvs commit: jakarta-james/src/java/org/apache/james/testing
BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh
testconf.xml


>
> -1
>
> This is test code and thus shouldn't be wrapped up with the production
> deliverable.
>
> Moreover, files that need to be modified by the end users (in this case
> runtest.bat, runtest.sh, testconf.xml) shouldn't be in the src/java
> directory.
>
> Please delete and move the code to a more appropriate set of
> directories.
>
> --Peter
>
> > -----Original Message-----
> > From: hbedi@apache.org [mailto:hbedi@apache.org]
> > Sent: Saturday, October 12, 2002 12:35 PM
> > To: jakarta-james-cvs@apache.org
> > Subject: cvs commit: jakarta-james/src/java/org/apache/james/testing
> > BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat
> > runtest.sh testconf.xml
> >
> > hbedi       2002/10/12 12:35:18
> >
> >   Added:       src/java/org/apache/james/testing BaseTest.java
> Main.java
> >                         POP3Test.java TestMethod.java runtest.bat
> >                         runtest.sh testconf.xml
> >   Log:
> >   test suite and pop3 test.
> >
> >   Revision  Changes    Path
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/BaseTest.java
> >
> >   Index: BaseTest.java
> >   ===================================================================
> >   /*
> >    * Copyright (C) The Apache Software Foundation. All rights
> reserved.
> >    *
> >    * This software is published under the terms of the Apache Software
> > License
> >    * version 1.1, a copy of which has been included with this
> distribution
> > in
> >    * the LICENSE file.
> >    */
> >   package org.apache.james.testing;
> >
> >   import junit.framework.TestCase;
> >   import org.apache.avalon.framework.configuration.Configurable;
> >   import org.apache.avalon.framework.configuration.Configuration;
> >   import
> org.apache.avalon.framework.configuration.ConfigurationException;
> >
> >   /**
> >    * Base Test class. Can run a set of tests.
> >    */
> >   public class BaseTest extends TestCase implements Configurable {
> >
> >       private TestMethod[] testMethod;
> >       private boolean showStat;
> >
> >       public BaseTest(String name) {
> >           super(name);
> >       }
> >
> >       public void configure(Configuration configuration)
> >           throws ConfigurationException
> >       {
> >           // list of test methods
> >           Configuration testseq =
> configuration.getChild("testsequence");
> >           showStat = testseq.getAttributeAsBoolean("showStat");
> >           Configuration[] testconf =
> testseq.getChildren("testmethod");
> >           testMethod = new TestMethod[testconf.length];
> >           for ( int i = 0 ; i < testMethod.length ; i++ )
> >               testMethod[i] = new TestMethod(testconf[i].getValue());
> >       }
> >
> >       public final int countTestCases() {
> >           return testMethod.length;
> >       }
> >
> >       protected final void runTest() throws Throwable {
> >           for ( int i = 0 ; i < testMethod.length ; i++ ) {
> >               testMethod[i].invoke(this);
> >               if ( showStat )
> >                   System.out.println("stat: "+getName()+",
> > "+testMethod[i]);
> >           }
> >       }
> >   }
> >
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/Main.java
> >
> >   Index: Main.java
> >   ===================================================================
> >   /*
> >    * Copyright (C) The Apache Software Foundation. All rights
> reserved.
> >    *
> >    * This software is published under the terms of the Apache Software
> > License
> >    * version 1.1, a copy of which has been included with this
> distribution
> > in
> >    * the LICENSE file.
> >    */
> >   package org.apache.james.testing;
> >
> >   import junit.framework.*;
> >   import junit.extensions.*;
> >   import junit.textui.*;
> >   import java.io.*;
> >   import org.apache.avalon.framework.configuration.*;
> >   import java.lang.reflect.*;
> >
> >   /**
> >    * Run tests.
> >    * - Reads test configuration file, constructs test suite
> >    * - initiates tests, reports result.
> >    */
> >   public class Main {
> >       public static void main(String[] args) throws Exception {
> >           System.out.println("Usage java org.apache.james.testing.Main
> > <testconfigfile>");
> >
> >           File testconfFile = new File(args[0]);
> >           DefaultConfigurationBuilder builder = new
> > DefaultConfigurationBuilder();
> >           Configuration alltestconf =
> builder.buildFromFile(testconfFile);
> >           Configuration[] testconf = alltestconf.getChildren("test");
> >           TestSuite alltests = new TestSuite();
> >           for ( int i = 0 ; i < testconf.length ; i++ ) {
> >               Configuration conf = testconf[i];
> >               String clsname = conf.getAttribute("class");
> >               String name = conf.getAttribute("name");
> >               int repetition =
> conf.getAttributeAsInteger("repetition");
> >               boolean async = conf.getAttributeAsBoolean("async");
> >
> >               Class clazz = Class.forName(clsname);
> >               Constructor cstr = clazz.getConstructor(new Class[] {
> > String.class });
> >               Test test = (Test)cstr.newInstance(new Object[] {name});
> >               if ( test instanceof Configurable )
> >                   ((Configurable)test).configure(conf);
> >
> >               if (repetition > 1)
> >                   test = new RepeatedTest(test,repetition);
> >
> >               if ( async ) {
> >                   TestSuite ts = new ActiveTestSuite();
> >                   ts.addTest(test);
> >                   test = ts;
> >               }
> >               alltests.addTest(test);
> >           }
> >           TestRunner.run(alltests);
> >       }
> >   }
> >
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/POP3Test.java
> >
> >   Index: POP3Test.java
> >   ===================================================================
> >   /*
> >    * Copyright (C) The Apache Software Foundation. All rights
> reserved.
> >    *
> >    * This software is published under the terms of the Apache Software
> > License
> >    * version 1.1, a copy of which has been included with this
> distribution
> > in
> >    * the LICENSE file.
> >    */
> >   package org.apache.james.testing;
> >
> >   import java.io.InputStream;
> >   import java.io.FileOutputStream;
> >   import java.io.OutputStream;
> >   import javax.mail.internet.MimeMessage;
> >   import org.apache.avalon.excalibur.io.IOUtil;
> >   import org.apache.avalon.framework.configuration.Configuration;
> >   import
> org.apache.avalon.framework.configuration.ConfigurationException;
> >   import org.apache.commons.net.SocketClient;
> >   import org.apache.commons.net.pop3.POP3;
> >   import org.apache.commons.net.pop3.POP3Client;
> >   import org.apache.commons.net.pop3.POP3MessageInfo;
> >   import org.apache.james.fetchpop.ReaderInputStream;
> >
> >   /**
> >    * Fetch mail. Can be configured and extended to test specific pop3
> >    * operations.
> >    */
> >   public class POP3Test extends BaseTest {
> >       private String host, username, password;
> >
> >       public POP3Test(String name) {
> >           super(name);
> >       }
> >
> >       public void configure(Configuration configuration)
> >           throws ConfigurationException
> >       {
> >           this.host = configuration.getChild("host").getValue();
> >           this.username =
> configuration.getChild("username").getValue();
> >           this.password =
> configuration.getChild("password").getValue();
> >           super.configure(configuration);
> >       }
> >
> >       private POP3Client client;
> >
> >       protected void setUp() throws Exception {
> >           client = new POP3Client();
> >           client.connect(host);
> >       }
> >
> >       protected void tearDown() throws Exception {
> >           client.disconnect();
> >       }
> >
> >       // ----------- pop3 operations ------------
> >
> >       private POP3MessageInfo[] msg;
> >       private static int saveMsgCounter;
> >
> >       public void login() throws Exception {
> >           client.login(username, password);
> >       }
> >       public void logout() throws Exception {
> >           client.logout();
> >       }
> >       public void fetchMsgsInfo() throws Exception {
> >           msg = client.listMessages();
> >       }
> >
> >       public void fetchMsgs() throws Exception {
> >           for ( int i = 0 ; i < msg.length ; i++ )
> >               fetchMsg(msg[i],false);
> >       }
> >
> >       public void fetchAndSaveMsgs() throws Exception {
> >           for ( int i = 0 ; i < msg.length ; i++ )
> >               fetchMsg(msg[i],true);
> >       }
> >
> >       public void deleteMsgs() throws Exception {
> >           for ( int i = 0 ; i < msg.length ; i++ )
> >               client.deleteMessage(msg[i].number);
> >       }
> >
> >       private void fetchMsg(POP3MessageInfo msg,boolean save) throws
> > Exception {
> >           InputStream in = new
> > ReaderInputStream(client.retrieveMessage(msg.number));
> >           try {
> >               MimeMessage message = new MimeMessage(null, in);
> >               if ( save ) {
> >                   OutputStream out = new FileOutputStream
> >                       ("pop3test-"+host+"-
> > "+username+"."+(saveMsgCounter++)+".eml");
> >                   try {
> >                       message.writeTo(out);
> >                   } finally {
> >                       IOUtil.shutdownStream(out);
> >                   }
> >               }
> >           } finally {
> >               IOUtil.shutdownStream(in);
> >           }
> >       }
> >   }
> >
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/TestMethod.java
> >
> >   Index: TestMethod.java
> >   ===================================================================
> >   /*
> >    * Copyright (C) The Apache Software Foundation. All rights
> reserved.
> >    *
> >    * This software is published under the terms of the Apache Software
> > License
> >    * version 1.1, a copy of which has been included with this
> distribution
> > in
> >    * the LICENSE file.
> >    */
> >   package org.apache.james.testing;
> >
> >   import java.lang.reflect.Method;
> >
> >   class TestMethod {
> >       // stats
> >       private int timeTaken;
> >       private int attempts;
> >       private int success;
> >
> >       final String name;
> >       TestMethod(String name) {
> >           this.name = name;
> >       }
> >
> >       // invoke test
> >       void invoke(Object obj) throws Exception {
> >           Method m = obj.getClass().getMethod(name,new Class[0]);
> >           attempts++;
> >           long st = System.currentTimeMillis();
> >           try {
> >               m.invoke(obj,new Object[0]);
> >               success++;
> >           } finally {
> >               timeTaken = (int)(System.currentTimeMillis() - st);
> >           }
> >       }
> >       // print report.
> >       public String toString() {
> >           return name+", "+timeTaken+", "+success+", "+attempts;
> >       }
> >   }
> >
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/runtest.bat
> >
> >   Index: runtest.bat
> >   ===================================================================
> >   echo 'runs james test suite and outputs result in csv file format'
> >   echo 'test, method, time taken, successful invocations, invocation
> > attempt'
> >   java org.apache.james.testing.Main testconf.xml | grep "stat: " |
> sed
> > "s/.*stat: //g"
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/runtest.sh
> >
> >   Index: runtest.sh
> >   ===================================================================
> >   echo 'runs james test suite and outputs result in csv file format'
> >   echo 'test, method, time taken, successful invocations, invocation
> > attempt'
> >   java org.apache.james.testing.Main testconf.xml | grep "stat: " |
> sed
> > "s/.*stat: //g"
> >
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/testconf.xml
> >
> >   Index: testconf.xml
> >   ===================================================================
> >   <!-- test configuration file -->
> >   <testsuite>
> >   <test name="pop3test" async="true" repetition="5"
> > class="org.apache.james.testing.POP3Test">
> >     <host>localhost</host>
> >     <username>harmeet</username>
> >     <password>harmeet</password>
> >
> >     <!-- call these test methods -->
> >     <testsequence showStat="true">
> >       <testmethod>login</testmethod>
> >       <testmethod>fetchMsgsInfo</testmethod>
> >       <testmethod>fetchMsgs</testmethod>
> >       <testmethod>logout</testmethod>
> >     </testsequence>
> >   </test>
> >   <test name="pop3test" async="true" repetition="5"
> > class="org.apache.james.testing.POP3Test">
> >     <host>localhost</host>
> >     <username>user1</username>
> >     <password>user1</password>
> >
> >     <!-- call these test methods -->
> >     <testsequence showStat="true">
> >       <testmethod>login</testmethod>
> >       <testmethod>fetchMsgsInfo</testmethod>
> >       <testmethod>fetchMsgs</testmethod>
> >       <testmethod>logout</testmethod>
> >     </testsequence>
> >   </test>
> >   <test name="pop3test" async="true" repetition="5"
> > class="org.apache.james.testing.POP3Test">
> >     <host>localhost</host>
> >     <username>user2</username>
> >     <password>user2</password>
> >
> >     <!-- call these test methods -->
> >     <testsequence showStat="true">
> >       <testmethod>login</testmethod>
> >       <testmethod>fetchMsgsInfo</testmethod>
> >       <testmethod>fetchMsgs</testmethod>
> >       <testmethod>logout</testmethod>
> >     </testsequence>
> >   </test>
> >   <test name="pop3test" async="true" repetition="5"
> > class="org.apache.james.testing.POP3Test">
> >     <host>localhost</host>
> >     <username>user3</username>
> >     <password>user3</password>
> >
> >     <!-- call these test methods -->
> >     <testsequence showStat="true">
> >       <testmethod>login</testmethod>
> >       <testmethod>fetchMsgsInfo</testmethod>
> >       <testmethod>fetchMsgs</testmethod>
> >       <testmethod>logout</testmethod>
> >     </testsequence>
> >   </test>
> >   <test name="pop3test" async="true" repetition="5"
> > class="org.apache.james.testing.POP3Test">
> >     <host>localhost</host>
> >     <username>user4</username>
> >     <password>user4</password>
> >
> >     <!-- call these test methods -->
> >     <testsequence showStat="true">
> >       <testmethod>login</testmethod>
> >       <testmethod>fetchMsgsInfo</testmethod>
> >       <testmethod>fetchMsgs</testmethod>
> >       <testmethod>logout</testmethod>
> >     </testsequence>
> >   </test>
> >   </testsuite>
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:james-dev-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:james-dev-
> > help@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Harmeet Bedi <ha...@kodemuse.com>.
----- Original Message -----
From: "Peter M. Goldstein" <pe...@yahoo.com>
> -1

I haven't added new libraries or packages or made any new proposals.
Testing package and junit library are both more than 1 year old.

What is this -1 for ?

runtest etc. are not ment for end users. Testing is for developers.

Testing is really important and should be encouraged as much as possible
rather than building new hoops for it.

Harmeet
>
> This is test code and thus shouldn't be wrapped up with the production
> deliverable.
>
> Moreover, files that need to be modified by the end users (in this case
> runtest.bat, runtest.sh, testconf.xml) shouldn't be in the src/java
> directory.
>
> Please delete and move the code to a more appropriate set of
> directories.
>
> --Peter
>
> > -----Original Message-----
> > From: hbedi@apache.org [mailto:hbedi@apache.org]
> > Sent: Saturday, October 12, 2002 12:35 PM
> > To: jakarta-james-cvs@apache.org
> > Subject: cvs commit: jakarta-james/src/java/org/apache/james/testing
> > BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat
> > runtest.sh testconf.xml
> >
> > hbedi       2002/10/12 12:35:18
> >
> >   Added:       src/java/org/apache/james/testing BaseTest.java
> Main.java
> >                         POP3Test.java TestMethod.java runtest.bat
> >                         runtest.sh testconf.xml
> >   Log:
> >   test suite and pop3 test.
> >
> >   Revision  Changes    Path
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/BaseTest.java
> >
> >   Index: BaseTest.java
> >   ===================================================================
> >   /*
> >    * Copyright (C) The Apache Software Foundation. All rights
> reserved.
> >    *
> >    * This software is published under the terms of the Apache Software
> > License
> >    * version 1.1, a copy of which has been included with this
> distribution
> > in
> >    * the LICENSE file.
> >    */
> >   package org.apache.james.testing;
> >
> >   import junit.framework.TestCase;
> >   import org.apache.avalon.framework.configuration.Configurable;
> >   import org.apache.avalon.framework.configuration.Configuration;
> >   import
> org.apache.avalon.framework.configuration.ConfigurationException;
> >
> >   /**
> >    * Base Test class. Can run a set of tests.
> >    */
> >   public class BaseTest extends TestCase implements Configurable {
> >
> >       private TestMethod[] testMethod;
> >       private boolean showStat;
> >
> >       public BaseTest(String name) {
> >           super(name);
> >       }
> >
> >       public void configure(Configuration configuration)
> >           throws ConfigurationException
> >       {
> >           // list of test methods
> >           Configuration testseq =
> configuration.getChild("testsequence");
> >           showStat = testseq.getAttributeAsBoolean("showStat");
> >           Configuration[] testconf =
> testseq.getChildren("testmethod");
> >           testMethod = new TestMethod[testconf.length];
> >           for ( int i = 0 ; i < testMethod.length ; i++ )
> >               testMethod[i] = new TestMethod(testconf[i].getValue());
> >       }
> >
> >       public final int countTestCases() {
> >           return testMethod.length;
> >       }
> >
> >       protected final void runTest() throws Throwable {
> >           for ( int i = 0 ; i < testMethod.length ; i++ ) {
> >               testMethod[i].invoke(this);
> >               if ( showStat )
> >                   System.out.println("stat: "+getName()+",
> > "+testMethod[i]);
> >           }
> >       }
> >   }
> >
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/Main.java
> >
> >   Index: Main.java
> >   ===================================================================
> >   /*
> >    * Copyright (C) The Apache Software Foundation. All rights
> reserved.
> >    *
> >    * This software is published under the terms of the Apache Software
> > License
> >    * version 1.1, a copy of which has been included with this
> distribution
> > in
> >    * the LICENSE file.
> >    */
> >   package org.apache.james.testing;
> >
> >   import junit.framework.*;
> >   import junit.extensions.*;
> >   import junit.textui.*;
> >   import java.io.*;
> >   import org.apache.avalon.framework.configuration.*;
> >   import java.lang.reflect.*;
> >
> >   /**
> >    * Run tests.
> >    * - Reads test configuration file, constructs test suite
> >    * - initiates tests, reports result.
> >    */
> >   public class Main {
> >       public static void main(String[] args) throws Exception {
> >           System.out.println("Usage java org.apache.james.testing.Main
> > <testconfigfile>");
> >
> >           File testconfFile = new File(args[0]);
> >           DefaultConfigurationBuilder builder = new
> > DefaultConfigurationBuilder();
> >           Configuration alltestconf =
> builder.buildFromFile(testconfFile);
> >           Configuration[] testconf = alltestconf.getChildren("test");
> >           TestSuite alltests = new TestSuite();
> >           for ( int i = 0 ; i < testconf.length ; i++ ) {
> >               Configuration conf = testconf[i];
> >               String clsname = conf.getAttribute("class");
> >               String name = conf.getAttribute("name");
> >               int repetition =
> conf.getAttributeAsInteger("repetition");
> >               boolean async = conf.getAttributeAsBoolean("async");
> >
> >               Class clazz = Class.forName(clsname);
> >               Constructor cstr = clazz.getConstructor(new Class[] {
> > String.class });
> >               Test test = (Test)cstr.newInstance(new Object[] {name});
> >               if ( test instanceof Configurable )
> >                   ((Configurable)test).configure(conf);
> >
> >               if (repetition > 1)
> >                   test = new RepeatedTest(test,repetition);
> >
> >               if ( async ) {
> >                   TestSuite ts = new ActiveTestSuite();
> >                   ts.addTest(test);
> >                   test = ts;
> >               }
> >               alltests.addTest(test);
> >           }
> >           TestRunner.run(alltests);
> >       }
> >   }
> >
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/POP3Test.java
> >
> >   Index: POP3Test.java
> >   ===================================================================
> >   /*
> >    * Copyright (C) The Apache Software Foundation. All rights
> reserved.
> >    *
> >    * This software is published under the terms of the Apache Software
> > License
> >    * version 1.1, a copy of which has been included with this
> distribution
> > in
> >    * the LICENSE file.
> >    */
> >   package org.apache.james.testing;
> >
> >   import java.io.InputStream;
> >   import java.io.FileOutputStream;
> >   import java.io.OutputStream;
> >   import javax.mail.internet.MimeMessage;
> >   import org.apache.avalon.excalibur.io.IOUtil;
> >   import org.apache.avalon.framework.configuration.Configuration;
> >   import
> org.apache.avalon.framework.configuration.ConfigurationException;
> >   import org.apache.commons.net.SocketClient;
> >   import org.apache.commons.net.pop3.POP3;
> >   import org.apache.commons.net.pop3.POP3Client;
> >   import org.apache.commons.net.pop3.POP3MessageInfo;
> >   import org.apache.james.fetchpop.ReaderInputStream;
> >
> >   /**
> >    * Fetch mail. Can be configured and extended to test specific pop3
> >    * operations.
> >    */
> >   public class POP3Test extends BaseTest {
> >       private String host, username, password;
> >
> >       public POP3Test(String name) {
> >           super(name);
> >       }
> >
> >       public void configure(Configuration configuration)
> >           throws ConfigurationException
> >       {
> >           this.host = configuration.getChild("host").getValue();
> >           this.username =
> configuration.getChild("username").getValue();
> >           this.password =
> configuration.getChild("password").getValue();
> >           super.configure(configuration);
> >       }
> >
> >       private POP3Client client;
> >
> >       protected void setUp() throws Exception {
> >           client = new POP3Client();
> >           client.connect(host);
> >       }
> >
> >       protected void tearDown() throws Exception {
> >           client.disconnect();
> >       }
> >
> >       // ----------- pop3 operations ------------
> >
> >       private POP3MessageInfo[] msg;
> >       private static int saveMsgCounter;
> >
> >       public void login() throws Exception {
> >           client.login(username, password);
> >       }
> >       public void logout() throws Exception {
> >           client.logout();
> >       }
> >       public void fetchMsgsInfo() throws Exception {
> >           msg = client.listMessages();
> >       }
> >
> >       public void fetchMsgs() throws Exception {
> >           for ( int i = 0 ; i < msg.length ; i++ )
> >               fetchMsg(msg[i],false);
> >       }
> >
> >       public void fetchAndSaveMsgs() throws Exception {
> >           for ( int i = 0 ; i < msg.length ; i++ )
> >               fetchMsg(msg[i],true);
> >       }
> >
> >       public void deleteMsgs() throws Exception {
> >           for ( int i = 0 ; i < msg.length ; i++ )
> >               client.deleteMessage(msg[i].number);
> >       }
> >
> >       private void fetchMsg(POP3MessageInfo msg,boolean save) throws
> > Exception {
> >           InputStream in = new
> > ReaderInputStream(client.retrieveMessage(msg.number));
> >           try {
> >               MimeMessage message = new MimeMessage(null, in);
> >               if ( save ) {
> >                   OutputStream out = new FileOutputStream
> >                       ("pop3test-"+host+"-
> > "+username+"."+(saveMsgCounter++)+".eml");
> >                   try {
> >                       message.writeTo(out);
> >                   } finally {
> >                       IOUtil.shutdownStream(out);
> >                   }
> >               }
> >           } finally {
> >               IOUtil.shutdownStream(in);
> >           }
> >       }
> >   }
> >
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/TestMethod.java
> >
> >   Index: TestMethod.java
> >   ===================================================================
> >   /*
> >    * Copyright (C) The Apache Software Foundation. All rights
> reserved.
> >    *
> >    * This software is published under the terms of the Apache Software
> > License
> >    * version 1.1, a copy of which has been included with this
> distribution
> > in
> >    * the LICENSE file.
> >    */
> >   package org.apache.james.testing;
> >
> >   import java.lang.reflect.Method;
> >
> >   class TestMethod {
> >       // stats
> >       private int timeTaken;
> >       private int attempts;
> >       private int success;
> >
> >       final String name;
> >       TestMethod(String name) {
> >           this.name = name;
> >       }
> >
> >       // invoke test
> >       void invoke(Object obj) throws Exception {
> >           Method m = obj.getClass().getMethod(name,new Class[0]);
> >           attempts++;
> >           long st = System.currentTimeMillis();
> >           try {
> >               m.invoke(obj,new Object[0]);
> >               success++;
> >           } finally {
> >               timeTaken = (int)(System.currentTimeMillis() - st);
> >           }
> >       }
> >       // print report.
> >       public String toString() {
> >           return name+", "+timeTaken+", "+success+", "+attempts;
> >       }
> >   }
> >
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/runtest.bat
> >
> >   Index: runtest.bat
> >   ===================================================================
> >   echo 'runs james test suite and outputs result in csv file format'
> >   echo 'test, method, time taken, successful invocations, invocation
> > attempt'
> >   java org.apache.james.testing.Main testconf.xml | grep "stat: " |
> sed
> > "s/.*stat: //g"
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/runtest.sh
> >
> >   Index: runtest.sh
> >   ===================================================================
> >   echo 'runs james test suite and outputs result in csv file format'
> >   echo 'test, method, time taken, successful invocations, invocation
> > attempt'
> >   java org.apache.james.testing.Main testconf.xml | grep "stat: " |
> sed
> > "s/.*stat: //g"
> >
> >
> >
> >   1.1                  jakarta-
> > james/src/java/org/apache/james/testing/testconf.xml
> >
> >   Index: testconf.xml
> >   ===================================================================
> >   <!-- test configuration file -->
> >   <testsuite>
> >   <test name="pop3test" async="true" repetition="5"
> > class="org.apache.james.testing.POP3Test">
> >     <host>localhost</host>
> >     <username>harmeet</username>
> >     <password>harmeet</password>
> >
> >     <!-- call these test methods -->
> >     <testsequence showStat="true">
> >       <testmethod>login</testmethod>
> >       <testmethod>fetchMsgsInfo</testmethod>
> >       <testmethod>fetchMsgs</testmethod>
> >       <testmethod>logout</testmethod>
> >     </testsequence>
> >   </test>
> >   <test name="pop3test" async="true" repetition="5"
> > class="org.apache.james.testing.POP3Test">
> >     <host>localhost</host>
> >     <username>user1</username>
> >     <password>user1</password>
> >
> >     <!-- call these test methods -->
> >     <testsequence showStat="true">
> >       <testmethod>login</testmethod>
> >       <testmethod>fetchMsgsInfo</testmethod>
> >       <testmethod>fetchMsgs</testmethod>
> >       <testmethod>logout</testmethod>
> >     </testsequence>
> >   </test>
> >   <test name="pop3test" async="true" repetition="5"
> > class="org.apache.james.testing.POP3Test">
> >     <host>localhost</host>
> >     <username>user2</username>
> >     <password>user2</password>
> >
> >     <!-- call these test methods -->
> >     <testsequence showStat="true">
> >       <testmethod>login</testmethod>
> >       <testmethod>fetchMsgsInfo</testmethod>
> >       <testmethod>fetchMsgs</testmethod>
> >       <testmethod>logout</testmethod>
> >     </testsequence>
> >   </test>
> >   <test name="pop3test" async="true" repetition="5"
> > class="org.apache.james.testing.POP3Test">
> >     <host>localhost</host>
> >     <username>user3</username>
> >     <password>user3</password>
> >
> >     <!-- call these test methods -->
> >     <testsequence showStat="true">
> >       <testmethod>login</testmethod>
> >       <testmethod>fetchMsgsInfo</testmethod>
> >       <testmethod>fetchMsgs</testmethod>
> >       <testmethod>logout</testmethod>
> >     </testsequence>
> >   </test>
> >   <test name="pop3test" async="true" repetition="5"
> > class="org.apache.james.testing.POP3Test">
> >     <host>localhost</host>
> >     <username>user4</username>
> >     <password>user4</password>
> >
> >     <!-- call these test methods -->
> >     <testsequence showStat="true">
> >       <testmethod>login</testmethod>
> >       <testmethod>fetchMsgsInfo</testmethod>
> >       <testmethod>fetchMsgs</testmethod>
> >       <testmethod>logout</testmethod>
> >     </testsequence>
> >   </test>
> >   </testsuite>
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:james-dev-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:james-dev-
> > help@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Harmeet Bedi <ha...@kodemuse.com>.
----- Original Message -----
From: "Noel J. Bergman" <no...@devtech.com>
>
> Isn't this a separate item used to test james?  Should this go into
> proposals/, and have a separate build target?

Tests have been part of source for some time now. You will notice there is a
testing package.

I think it is more important to get tests in than be picky about ~ 10K.

Harmeet


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by "Noel J. Bergman" <no...@devtech.com>.
> This is test code and thus shouldn't be wrapped up with the production
> deliverable.

> Please delete and move the code to a more appropriate set of
> directories.

Isn't this a separate item used to test james?  Should this go into
proposals/, and have a separate build target?

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by "Noel J. Bergman" <no...@devtech.com>.
> In any case packaging test cases so that users can also
> use them is no bad thing, as the tests evolve we can use
> them to allow people to make better bug reports.

Depends upon the kind of test, but I do agree that some tests that can be
run on the user's system might be good.  Things that check, for example, the
integrity of a repository or the proper configuration of the processor chain
(a frequent source of pilot error).

We all want better tests.  The "stop what you're doing until we develop a
test suite" is my primary objection.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Danny Angus <da...@apache.org>.
then we do agree..

> -----Original Message-----
> From: Peter M. Goldstein [mailto:peter_m_goldstein@yahoo.com]
> Sent: 12 October 2002 23:05
> To: 'James Developers List'
> Subject: RE: cvs commit: jakarta-james/src/java/org/apache/james/testing
> BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat
> runtest.sh testconf.xml
> 
> 
> 
> Danny,
> 
> > > This is test code and thus shouldn't be wrapped up with the
> production
> > > deliverable.
> > 
> > it can be in the o.a.james package, surely, just excluded from
> james.jar.
> 
> For the Java files, that would be fine.  That means that an appropriate
> modification to the build.xml should be included with any future
> submission of the test-suite.
>  
> > In any case packaging test cases so that users can also use them is no
> bad
> > thing, as the tests evolve we can use them to allow people to make
> better
> > bug reports.
> 
> I don't have an objection to packaging test suites so users can (if they
> so choose) use them.  I do have an objection to bundling them in with
> the .jar required for a basic production system.  There are a number of
> very good reasons why you need to be able to keep them separate.
> 
> I also have an objection to contaminating the src/java directory with
> batch and user-modifiable configuration files.
> 
> --Peter
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Alan Gerhard <al...@GerCom.Com>.
<B>+1</B>
...
I don't have an objection to packaging test suites so users can (if they
so choose) use them.  I do have an objection to bundling them in with
the .jar required for a basic production system.  There are a number of
very good reasons why you need to be able to keep them separate.

I also have an objection to contaminating the src/java directory with
batch and user-modifiable configuration files.
...


a clear distinction needs to be made to what is a production system and what
constitutes a developers environment.
Without this, we end up with a chaotic collection of code, though useful it
may be, and maintenance becomes more difficult and complex.

Alan Gerhard


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by "Peter M. Goldstein" <pe...@yahoo.com>.
Danny,

> > This is test code and thus shouldn't be wrapped up with the
production
> > deliverable.
> 
> it can be in the o.a.james package, surely, just excluded from
james.jar.

For the Java files, that would be fine.  That means that an appropriate
modification to the build.xml should be included with any future
submission of the test-suite.
 
> In any case packaging test cases so that users can also use them is no
bad
> thing, as the tests evolve we can use them to allow people to make
better
> bug reports.

I don't have an objection to packaging test suites so users can (if they
so choose) use them.  I do have an objection to bundling them in with
the .jar required for a basic production system.  There are a number of
very good reasons why you need to be able to keep them separate.

I also have an objection to contaminating the src/java directory with
batch and user-modifiable configuration files.

--Peter




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by Danny Angus <da...@apache.org>.
> This is test code and thus shouldn't be wrapped up with the production
> deliverable.

it can be in the o.a.james package, surely, just excluded from james.jar.

In any case packaging test cases so that users can also use them is no bad thing, as the tests evolve we can use them to allow people to make better bug reports.



d.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-james/src/java/org/apache/james/testing BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat runtest.sh testconf.xml

Posted by "Peter M. Goldstein" <pe...@yahoo.com>.
-1

This is test code and thus shouldn't be wrapped up with the production
deliverable.

Moreover, files that need to be modified by the end users (in this case
runtest.bat, runtest.sh, testconf.xml) shouldn't be in the src/java
directory.

Please delete and move the code to a more appropriate set of
directories.

--Peter

> -----Original Message-----
> From: hbedi@apache.org [mailto:hbedi@apache.org]
> Sent: Saturday, October 12, 2002 12:35 PM
> To: jakarta-james-cvs@apache.org
> Subject: cvs commit: jakarta-james/src/java/org/apache/james/testing
> BaseTest.java Main.java POP3Test.java TestMethod.java runtest.bat
> runtest.sh testconf.xml
> 
> hbedi       2002/10/12 12:35:18
> 
>   Added:       src/java/org/apache/james/testing BaseTest.java
Main.java
>                         POP3Test.java TestMethod.java runtest.bat
>                         runtest.sh testconf.xml
>   Log:
>   test suite and pop3 test.
> 
>   Revision  Changes    Path
>   1.1                  jakarta-
> james/src/java/org/apache/james/testing/BaseTest.java
> 
>   Index: BaseTest.java
>   ===================================================================
>   /*
>    * Copyright (C) The Apache Software Foundation. All rights
reserved.
>    *
>    * This software is published under the terms of the Apache Software
> License
>    * version 1.1, a copy of which has been included with this
distribution
> in
>    * the LICENSE file.
>    */
>   package org.apache.james.testing;
> 
>   import junit.framework.TestCase;
>   import org.apache.avalon.framework.configuration.Configurable;
>   import org.apache.avalon.framework.configuration.Configuration;
>   import
org.apache.avalon.framework.configuration.ConfigurationException;
> 
>   /**
>    * Base Test class. Can run a set of tests.
>    */
>   public class BaseTest extends TestCase implements Configurable {
> 
>       private TestMethod[] testMethod;
>       private boolean showStat;
> 
>       public BaseTest(String name) {
>           super(name);
>       }
> 
>       public void configure(Configuration configuration)
>           throws ConfigurationException
>       {
>           // list of test methods
>           Configuration testseq =
configuration.getChild("testsequence");
>           showStat = testseq.getAttributeAsBoolean("showStat");
>           Configuration[] testconf =
testseq.getChildren("testmethod");
>           testMethod = new TestMethod[testconf.length];
>           for ( int i = 0 ; i < testMethod.length ; i++ )
>               testMethod[i] = new TestMethod(testconf[i].getValue());
>       }
> 
>       public final int countTestCases() {
>           return testMethod.length;
>       }
> 
>       protected final void runTest() throws Throwable {
>           for ( int i = 0 ; i < testMethod.length ; i++ ) {
>               testMethod[i].invoke(this);
>               if ( showStat )
>                   System.out.println("stat: "+getName()+",
> "+testMethod[i]);
>           }
>       }
>   }
> 
> 
> 
>   1.1                  jakarta-
> james/src/java/org/apache/james/testing/Main.java
> 
>   Index: Main.java
>   ===================================================================
>   /*
>    * Copyright (C) The Apache Software Foundation. All rights
reserved.
>    *
>    * This software is published under the terms of the Apache Software
> License
>    * version 1.1, a copy of which has been included with this
distribution
> in
>    * the LICENSE file.
>    */
>   package org.apache.james.testing;
> 
>   import junit.framework.*;
>   import junit.extensions.*;
>   import junit.textui.*;
>   import java.io.*;
>   import org.apache.avalon.framework.configuration.*;
>   import java.lang.reflect.*;
> 
>   /**
>    * Run tests.
>    * - Reads test configuration file, constructs test suite
>    * - initiates tests, reports result.
>    */
>   public class Main {
>       public static void main(String[] args) throws Exception {
>           System.out.println("Usage java org.apache.james.testing.Main
> <testconfigfile>");
> 
>           File testconfFile = new File(args[0]);
>           DefaultConfigurationBuilder builder = new
> DefaultConfigurationBuilder();
>           Configuration alltestconf =
builder.buildFromFile(testconfFile);
>           Configuration[] testconf = alltestconf.getChildren("test");
>           TestSuite alltests = new TestSuite();
>           for ( int i = 0 ; i < testconf.length ; i++ ) {
>               Configuration conf = testconf[i];
>               String clsname = conf.getAttribute("class");
>               String name = conf.getAttribute("name");
>               int repetition =
conf.getAttributeAsInteger("repetition");
>               boolean async = conf.getAttributeAsBoolean("async");
> 
>               Class clazz = Class.forName(clsname);
>               Constructor cstr = clazz.getConstructor(new Class[] {
> String.class });
>               Test test = (Test)cstr.newInstance(new Object[] {name});
>               if ( test instanceof Configurable )
>                   ((Configurable)test).configure(conf);
> 
>               if (repetition > 1)
>                   test = new RepeatedTest(test,repetition);
> 
>               if ( async ) {
>                   TestSuite ts = new ActiveTestSuite();
>                   ts.addTest(test);
>                   test = ts;
>               }
>               alltests.addTest(test);
>           }
>           TestRunner.run(alltests);
>       }
>   }
> 
> 
> 
>   1.1                  jakarta-
> james/src/java/org/apache/james/testing/POP3Test.java
> 
>   Index: POP3Test.java
>   ===================================================================
>   /*
>    * Copyright (C) The Apache Software Foundation. All rights
reserved.
>    *
>    * This software is published under the terms of the Apache Software
> License
>    * version 1.1, a copy of which has been included with this
distribution
> in
>    * the LICENSE file.
>    */
>   package org.apache.james.testing;
> 
>   import java.io.InputStream;
>   import java.io.FileOutputStream;
>   import java.io.OutputStream;
>   import javax.mail.internet.MimeMessage;
>   import org.apache.avalon.excalibur.io.IOUtil;
>   import org.apache.avalon.framework.configuration.Configuration;
>   import
org.apache.avalon.framework.configuration.ConfigurationException;
>   import org.apache.commons.net.SocketClient;
>   import org.apache.commons.net.pop3.POP3;
>   import org.apache.commons.net.pop3.POP3Client;
>   import org.apache.commons.net.pop3.POP3MessageInfo;
>   import org.apache.james.fetchpop.ReaderInputStream;
> 
>   /**
>    * Fetch mail. Can be configured and extended to test specific pop3
>    * operations.
>    */
>   public class POP3Test extends BaseTest {
>       private String host, username, password;
> 
>       public POP3Test(String name) {
>           super(name);
>       }
> 
>       public void configure(Configuration configuration)
>           throws ConfigurationException
>       {
>           this.host = configuration.getChild("host").getValue();
>           this.username =
configuration.getChild("username").getValue();
>           this.password =
configuration.getChild("password").getValue();
>           super.configure(configuration);
>       }
> 
>       private POP3Client client;
> 
>       protected void setUp() throws Exception {
>           client = new POP3Client();
>           client.connect(host);
>       }
> 
>       protected void tearDown() throws Exception {
>           client.disconnect();
>       }
> 
>       // ----------- pop3 operations ------------
> 
>       private POP3MessageInfo[] msg;
>       private static int saveMsgCounter;
> 
>       public void login() throws Exception {
>           client.login(username, password);
>       }
>       public void logout() throws Exception {
>           client.logout();
>       }
>       public void fetchMsgsInfo() throws Exception {
>           msg = client.listMessages();
>       }
> 
>       public void fetchMsgs() throws Exception {
>           for ( int i = 0 ; i < msg.length ; i++ )
>               fetchMsg(msg[i],false);
>       }
> 
>       public void fetchAndSaveMsgs() throws Exception {
>           for ( int i = 0 ; i < msg.length ; i++ )
>               fetchMsg(msg[i],true);
>       }
> 
>       public void deleteMsgs() throws Exception {
>           for ( int i = 0 ; i < msg.length ; i++ )
>               client.deleteMessage(msg[i].number);
>       }
> 
>       private void fetchMsg(POP3MessageInfo msg,boolean save) throws
> Exception {
>           InputStream in = new
> ReaderInputStream(client.retrieveMessage(msg.number));
>           try {
>               MimeMessage message = new MimeMessage(null, in);
>               if ( save ) {
>                   OutputStream out = new FileOutputStream
>                       ("pop3test-"+host+"-
> "+username+"."+(saveMsgCounter++)+".eml");
>                   try {
>                       message.writeTo(out);
>                   } finally {
>                       IOUtil.shutdownStream(out);
>                   }
>               }
>           } finally {
>               IOUtil.shutdownStream(in);
>           }
>       }
>   }
> 
> 
> 
>   1.1                  jakarta-
> james/src/java/org/apache/james/testing/TestMethod.java
> 
>   Index: TestMethod.java
>   ===================================================================
>   /*
>    * Copyright (C) The Apache Software Foundation. All rights
reserved.
>    *
>    * This software is published under the terms of the Apache Software
> License
>    * version 1.1, a copy of which has been included with this
distribution
> in
>    * the LICENSE file.
>    */
>   package org.apache.james.testing;
> 
>   import java.lang.reflect.Method;
> 
>   class TestMethod {
>       // stats
>       private int timeTaken;
>       private int attempts;
>       private int success;
> 
>       final String name;
>       TestMethod(String name) {
>           this.name = name;
>       }
> 
>       // invoke test
>       void invoke(Object obj) throws Exception {
>           Method m = obj.getClass().getMethod(name,new Class[0]);
>           attempts++;
>           long st = System.currentTimeMillis();
>           try {
>               m.invoke(obj,new Object[0]);
>               success++;
>           } finally {
>               timeTaken = (int)(System.currentTimeMillis() - st);
>           }
>       }
>       // print report.
>       public String toString() {
>           return name+", "+timeTaken+", "+success+", "+attempts;
>       }
>   }
> 
> 
> 
>   1.1                  jakarta-
> james/src/java/org/apache/james/testing/runtest.bat
> 
>   Index: runtest.bat
>   ===================================================================
>   echo 'runs james test suite and outputs result in csv file format'
>   echo 'test, method, time taken, successful invocations, invocation
> attempt'
>   java org.apache.james.testing.Main testconf.xml | grep "stat: " |
sed
> "s/.*stat: //g"
> 
> 
>   1.1                  jakarta-
> james/src/java/org/apache/james/testing/runtest.sh
> 
>   Index: runtest.sh
>   ===================================================================
>   echo 'runs james test suite and outputs result in csv file format'
>   echo 'test, method, time taken, successful invocations, invocation
> attempt'
>   java org.apache.james.testing.Main testconf.xml | grep "stat: " |
sed
> "s/.*stat: //g"
> 
> 
> 
>   1.1                  jakarta-
> james/src/java/org/apache/james/testing/testconf.xml
> 
>   Index: testconf.xml
>   ===================================================================
>   <!-- test configuration file -->
>   <testsuite>
>   <test name="pop3test" async="true" repetition="5"
> class="org.apache.james.testing.POP3Test">
>     <host>localhost</host>
>     <username>harmeet</username>
>     <password>harmeet</password>
> 
>     <!-- call these test methods -->
>     <testsequence showStat="true">
>       <testmethod>login</testmethod>
>       <testmethod>fetchMsgsInfo</testmethod>
>       <testmethod>fetchMsgs</testmethod>
>       <testmethod>logout</testmethod>
>     </testsequence>
>   </test>
>   <test name="pop3test" async="true" repetition="5"
> class="org.apache.james.testing.POP3Test">
>     <host>localhost</host>
>     <username>user1</username>
>     <password>user1</password>
> 
>     <!-- call these test methods -->
>     <testsequence showStat="true">
>       <testmethod>login</testmethod>
>       <testmethod>fetchMsgsInfo</testmethod>
>       <testmethod>fetchMsgs</testmethod>
>       <testmethod>logout</testmethod>
>     </testsequence>
>   </test>
>   <test name="pop3test" async="true" repetition="5"
> class="org.apache.james.testing.POP3Test">
>     <host>localhost</host>
>     <username>user2</username>
>     <password>user2</password>
> 
>     <!-- call these test methods -->
>     <testsequence showStat="true">
>       <testmethod>login</testmethod>
>       <testmethod>fetchMsgsInfo</testmethod>
>       <testmethod>fetchMsgs</testmethod>
>       <testmethod>logout</testmethod>
>     </testsequence>
>   </test>
>   <test name="pop3test" async="true" repetition="5"
> class="org.apache.james.testing.POP3Test">
>     <host>localhost</host>
>     <username>user3</username>
>     <password>user3</password>
> 
>     <!-- call these test methods -->
>     <testsequence showStat="true">
>       <testmethod>login</testmethod>
>       <testmethod>fetchMsgsInfo</testmethod>
>       <testmethod>fetchMsgs</testmethod>
>       <testmethod>logout</testmethod>
>     </testsequence>
>   </test>
>   <test name="pop3test" async="true" repetition="5"
> class="org.apache.james.testing.POP3Test">
>     <host>localhost</host>
>     <username>user4</username>
>     <password>user4</password>
> 
>     <!-- call these test methods -->
>     <testsequence showStat="true">
>       <testmethod>login</testmethod>
>       <testmethod>fetchMsgsInfo</testmethod>
>       <testmethod>fetchMsgs</testmethod>
>       <testmethod>logout</testmethod>
>     </testsequence>
>   </test>
>   </testsuite>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:james-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:james-dev-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>