You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ha...@apache.org on 2002/08/26 10:12:34 UTC

cvs commit: jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test AbstractHelloTestCase.java TestInterfaceImpl.java

hammant     2002/08/26 01:12:34

  Modified:    altrmi/src/test/org/apache/excalibur/altrmi/test
                        AbstractHelloTestCase.java TestInterfaceImpl.java
  Log:
  One more test
  
  Revision  Changes    Path
  1.5       +19 -2     jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/AbstractHelloTestCase.java
  
  Index: AbstractHelloTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/AbstractHelloTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractHelloTestCase.java	26 Aug 2002 07:55:12 -0000	1.4
  +++ AbstractHelloTestCase.java	26 Aug 2002 08:12:34 -0000	1.5
  @@ -104,8 +104,9 @@
           try
           {
               testClient.hello3((short) 91);
  -            fail("Expected a Excaption to be throw for hardcoded test 91");
  -        } catch (PropertyVetoException e)
  +            fail("Expected a Exception to be throw for hardcoded test 91");
  +        }
  +        catch (PropertyVetoException e)
           {
               fail("Wrong exception throw for hardcoded test 91");
           } catch (IOException e)
  @@ -116,6 +117,22 @@
           // test the server has logged the message.
           assertEquals("91", ((TestInterfaceImpl) testServer).getStoredState("boolean:hello3(short)"));
       }
  +
  +    public void testHello4Call() throws Exception
  +    {
  +        // lookup worked ?
  +        assertNotNull(testClient);
  +
  +        // Invoke a method over AltRMI.
  +        StringBuffer sb = testClient.hello4((float) 10.2, (double) 11.9);
  +        StringBuffer sb2 = (StringBuffer) ((TestInterfaceImpl) testServer).getStoredState("StringBuffer:hello4(float,double)");
  +
  +        // test the server has logged the message.
  +        assertEquals("10.2 11.9", sb2.toString());
  +        // test if the same instance.
  +        //assertEquals(sb, sb2);
  +    }
  +
   
       public void testSpeed() throws Exception
       {
  
  
  
  1.5       +4 -2      jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/TestInterfaceImpl.java
  
  Index: TestInterfaceImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/TestInterfaceImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestInterfaceImpl.java	26 Aug 2002 07:55:12 -0000	1.4
  +++ TestInterfaceImpl.java	26 Aug 2002 08:12:34 -0000	1.5
  @@ -54,7 +54,9 @@
       }
   
       public StringBuffer hello4(float greeting1, double greeting2) {
  -        throw new UnsupportedOperationException();
  +        StringBuffer sb = new StringBuffer("" + greeting1 + " " + greeting2);
  +        storedState.put("StringBuffer:hello4(float,double)", sb);
  +        return sb;
       }
   
       public void testSpeed() {
  
  
  

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