package examples.mega.client;

import java.rmi.RemoteException;

public class BasicMethod{

  public void invoke( MegaPort port ) throws RemoteException,
      InvokeFailedException {

    port.oneWayCall( System.currentTimeMillis() );

    String helloWorld = port.helloWorld();

    if( !helloWorld.equals( "helloWorld" ) ){
      throw new InvokeFailedException( "helloWorld" );
    }


    boolean called = port.overloadedMethod( true );

    if( called != true ){
      throw new InvokeFailedException( "overloadedMethod" );
    }

    String result = port.overloadedSoMadeDifferent( "called" );

    if( !result.equals( "called" ) ){
      throw new InvokeFailedException( "overloadedSoMadeDifferent" ); 
    }
  }
}

