public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
* tests with rmic
@ 2005-10-17 17:13 Nicolas Geoffray
  2005-10-18  2:37 ` Chris Abbey
  2005-10-18  8:41 ` tests with rmic! Meskauskas Audrius
  0 siblings, 2 replies; 6+ messages in thread
From: Nicolas Geoffray @ 2005-10-17 17:13 UTC (permalink / raw)
  To: mauve-discuss

[-- Attachment #1: Type: text/plain, Size: 536 bytes --]

Hi everyone,

I found what might be a bug in gnu classpath and I would like to commit 
a testlet in mauve. The thing is, my test involves compiling with rmic 
and launching two gnu classpath jvms. I never commited in mauve, but 
seeing other testlets, i didn't found ways to commit such a test.

I attached the files. This is how you launch the test:

gcj -C Main.java
gcj -C ReceiveObject.java
gcj -C ReceiveObjectImpl.java
rmic ReceiveObjectImpl

rmiregistry &
jamvm ReceiveObjectImpl &
jamvm Main


Any suggestions?

Thanks,
Nicolas

[-- Attachment #2: Main.java --]
[-- Type: text/x-java, Size: 443 bytes --]

import java.rmi.Naming;

public class Main{

  class Foo implements java.io.Serializable{}

  class Bar implements java.io.Serializable{
    Foo f = new Foo();
  }
    
  public static void main(String[]args){

    try{
      Bar b = new Bar();
      ReceiveObject ref = (ReceiveObject) Naming.lookup("rmi://localhost/ReceiveObject");
      ref.receiveObject(b);
    }catch(Exception e){
      System.out.println("Error : " + e );
    }
  }
}

[-- Attachment #3: ReceiveObject.java --]
[-- Type: text/x-java, Size: 179 bytes --]

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface ReceiveObject extends Remote{
  public Object receiveObject(Object unknown)
		throws RemoteException;
}

[-- Attachment #4: ReceiveObjectImpl.java --]
[-- Type: text/x-java, Size: 535 bytes --]

import java.rmi.*;
import java.rmi.server.*;


public class ReceiveObjectImpl extends UnicastRemoteObject implements ReceiveObject{

  public ReceiveObjectImpl() throws RemoteException{
  }

  public Object receiveObject(Object unknown)
    throws RemoteException{
      System.out.println(unknown);
      return null;
    }

  public static void main(String[] args){
    try{
      ReceiveObject ref = new ReceiveObjectImpl();
      Naming.rebind("ReceiveObject", ref);
    }catch(Exception e){
      e.printStackTrace();
    }
  }
}

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: tests with rmic
@ 2005-10-19  8:10 Nicolas Geoffray
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Geoffray @ 2005-10-19  8:10 UTC (permalink / raw)
  To: mauve-discuss

Hi Audrius

Meskauskas Audrius wrote:

>
> I looked at our gnu.java.rmi.server.UnicastRef and - yes, 
> unfortunately it seems that there is system property in Classpath that 
> would force the object serialization even if the RMI client and server 
> are in the same machine.
>
> If you plan serious testing work, we should probably add such property 
> as a necessary testing tool, but altering RMI implementation requires 
> to have a test suite first. I think, you can commit such tests anyway 
> because the object serialization is not the only thing in RMI that 
> deserves testing.
>
Unfortunately I do not plan for the moment serious rmi testing work. I 
just wanted to report a bug within gnu classpath. Because the test 
involves launching at least 2 vms, it's difficult to reveal the bug. The 
property forcing serialization would be great in my case!

Cheers,
Nicolas

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-10-19  8:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-17 17:13 tests with rmic Nicolas Geoffray
2005-10-18  2:37 ` Chris Abbey
2005-10-18  8:41 ` tests with rmic! Meskauskas Audrius
2005-10-18 11:47   ` Nicolas Geoffray
2005-10-18 18:10     ` tests with rmic Meskauskas Audrius
2005-10-19  8:10 Nicolas Geoffray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).