summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches/sca-java-1.5/samples/calculator-corba-service/README
blob: 87863752cda2ad26f83c43462fbb34b4568bfbb6 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Calculator CORBA Service Sample
=============================

This sample illustrates the use of Tuscany CORBA Binding to expose component 
services as CORBA objects. It also demonstrates how a simple Java CORBA 
Client application invokes the SCA Application's services exposed as CORBA 
Services.

The README in the samples directory (the directory above this) provides 
general instructions about building and running samples. Take a look there 
first. 


Sample Overview
---------------
This sample extends the calculator sample by replacing the local service 
binding with an CORBA binding. So a java client can call the service exposed
by the SCA application using an CORBA client. Name service which is used in 
CORBA communication is provided by Tuscany CORBA hosting module 
(maven dependency: tuscany-host-corba-jse-tns) - see CORBA binding reference
on Apache Tuscany website for details.

This sample adds a number of classes to the basic calculator sample:

calculator-corba-service/
  src/
    main/
      java/
        calculator/
          CalculatorService.java  - as calculator sample
          CalculatorServiceImpl.java
          AddService.java         - as calculator sample
          AddServiceImpl.java
          SubtractService.java    - as calculator sample
          SubtractServiceImpl.java
          MultiplyService.java    - as calculator sample
          MultiplyServiceImpl.java
          DivideService.java      - as calculator sample
          DivideServiceImpl.java
      resources/
        CalculatorCORBAServer.composite - the SCA assembly for this sample
    test/
      java/
        calculator/
          CalculatorCORBAServerTestCase.java          - JUnit test case
          idl/                                        - contains files generated 
                                                        from  IDL file. Files are 
                                                        used to access SCA component.
            CalculatorCORBAServiceHelper.java
            CalculatorCORBAService.java
            _CalculatorCORBAServiceStub.java
            CalculatorCORBAServiceHolder.java
            CalculatorCORBAServiceOperations.java
      resources/
        CalculatorCORBA.idl      - IDL description for SCA component
  pom.xml                         - the Maven build file   
  
Note. As this test creates and uses local network connections you may need to 
configure your firewall, if you are running one, to allow the test to run
successfully.

Building And Running The Sample Using Maven 
-------------------------------------------
With either the binary or source distributions the sample can be built and run 
using Maven as follows. 

cd calculator-corba-service
mvn

You should see the following output from the test phase.

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running calculator.CalculatorCORBAServerTestCase
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.819 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

This shows that the Junit test cases have run successfully.