summaryrefslogtreecommitdiff
path: root/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.cpp
blob: 6eddcc6653c2823882850d9b73b42b230cfa8d69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// -*- C++ -*-

#include "test_i.h"

ACE_RCSID (Request_Interceptor_Flow,
           test_i,
           "$Id$")

test_i::test_i (CORBA::ORB_ptr orb)
  : orb_ (CORBA::ORB::_duplicate (orb))
{
}

void
test_i::client_test (Test::TestScenario scenario)
{
  switch (scenario)
    {
    case 1:
    case 4:
      // Both the client-side and server-side tests throw this
      // exception in these scenarios.
      throw Test::X ();  // Expected test exception
    case 2:
    case 3:
      break;
    default:
      throw Test::UnknownScenario (scenario);  // Unexpected!
    }
}

void
test_i::server_test (Test::TestScenario scenario,
                     CORBA::ULongSeq_out myseq)
{
  myseq = new CORBA::ULongSeq;

  switch (scenario)
    {
    case 1:
    case 4:
      // Both the client-side and server-side tests throw this
      // exception in these scenarios.
      throw Test::X ();  // Expected test exception
    case 2:
    case 3:
      break;
    default:
      throw Test::UnknownScenario (scenario);  // Unexpected!
    }
}

void
test_i::shutdown (void)
{
  ACE_DEBUG ((LM_INFO,
              "Server is shutting down.\n"));

  this->orb_->shutdown (0);
}