Esempio n. 1
0
File: client.cpp Progetto: manut/TAO
int
run_big_reply_test (Test::Hello_ptr hello)
{
  ACE_DEBUG((LM_DEBUG,
              ACE_TEXT("start get_big_reply\n")));

  if (test == 2)
    {
      ACE_DEBUG((LM_DEBUG,
                 ACE_TEXT("*** NOTE TestCompressor is EXPECTED to throw IDL:omg.org/Compression/CompressionException ***\n")));
    }

  //Prepare to send a large number of bytes. Should be compressed
  Test::Octet_Seq_var dummy = hello->get_big_reply ();
  if (dummy->length () > 0)
    {
      ACE_DEBUG ((LM_DEBUG,
                  ACE_TEXT("get_big_reply, received = %d bytes\n"),
                      dummy->length ()));
    }
  else
    {
      ACE_ERROR_RETURN ((LM_ERROR,
                         ACE_TEXT ("ERROR : get_big_reply, ")
                         ACE_TEXT ("error receiving client side blob\n")),
                        1);
    }
  return 0;
}
Esempio n. 2
0
File: client.cpp Progetto: manut/TAO
int
run_string_test (Test::Hello_ptr hello)
{
  ACE_DEBUG((LM_DEBUG,
            ACE_TEXT("run_string_test, start\n")));

  if (test == 2)
    {
      ACE_DEBUG((LM_DEBUG,
                 ACE_TEXT("*** NOTE TestCompressor is EXPECTED to throw IDL:omg.org/Compression/CompressionException ***\n")));
    }

  CORBA::String_var the_string = hello->get_string ("This is a test string"
                                                    "This is a test string"
                                                    "This is a test string"
                                                    "This is a test string"
                                                    "This is a test string"
                                                    "This is a test string"
                                                    "This is a test string"
                                                    "This is a test string"
                                                    "This is a test string");
  ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%C>\n",
              the_string.in ()));
  if (ACE_OS::strstr (the_string.in (), "Hello there") == 0)
    {
      ACE_ERROR_RETURN ((LM_ERROR,
                         ACE_TEXT ("ERROR : run_string_test, unexpected string received\n")),
                        1);
    }

  return 0;
}
Esempio n. 3
0
void
Client_Task::test_user_exception_not_expected (
  Test::Hello_ptr hello_ptr)
{
  try
    {
      hello_ptr->user_exception_not_expected ();
    }
  catch (const CORBA::UNKNOWN& ex)
    {
      if ((ex.minor() & 0xFFFU) == 1)
        {
          ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Caught unknown exception as expected\n"));
        }
      else
        {
          ex._tao_print_exception (
            "Unexpected exception caught in user_exception_not_expected:");
          throw;
        }
      // ignore
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception (
        "Unexpected exception caught in user_exception_not_expected:");
      throw;
    }
}
Esempio n. 4
0
void
Hello::request_callback (Test::Hello_ptr call_me)
{
  ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Making call back !!!\n"));
  try
    {
      CORBA::String_var result = call_me->get_string ();
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception (
        "Exception attempting to callback client obj ref:\n");
      throw;
    }
  ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Call back succeeded !!!\n"));
}
Esempio n. 5
0
void
Client_Task::test_user_exception_expected (
  Test::Hello_ptr hello_ptr)
{
  try
    {
      hello_ptr->user_exception_expected ();
    }
  catch (const ::Test::Hello::A& )
    {
      ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Caught user A exception as expected\n"));
      // ignore
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception (
        "Unexpected exception caught in test_user_exception_expected:");
      throw;
    }
}
Esempio n. 6
0
void
Client_Task::test_system_exception (
  Test::Hello_ptr hello_ptr)
{
  try
    {
      hello_ptr->system_exception_test ();
    }
  catch (const CORBA::INTERNAL& )
    {
      ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Caught internal exception as expected\n"));
      // ignore
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception (
        "Unexpected exception caught in test_system_exception:");
      throw;
    }
}
Esempio n. 7
0
File: client.cpp Progetto: manut/TAO
int
run_big_request_test (Test::Hello_ptr hello)
{
  const int length = 40000;
  Test::Octet_Seq send_msg(length);
  send_msg.length (length);

  for (int i= 0; i<length; ++i)
    {
      send_msg[i]= static_cast<CORBA::Octet> (i & 0xff);
    }

  ACE_DEBUG((LM_DEBUG,
              ACE_TEXT("run_big_request_test, send = %d bytes\n"), length));

  if (test == 2)
    {
      ACE_DEBUG((LM_DEBUG,
                 ACE_TEXT("*** NOTE TestCompressor is EXPECTED to throw IDL:omg.org/Compression/CompressionException ***\n")));
    }

  hello->big_request(send_msg);
  return 0;
}