summaryrefslogtreecommitdiffstats
path: root/site/branches/site-20070701-mvnbased/site-author/java_das_overview.xml
blob: b3be6b4f3e9f63e6c5e4756829d72d579977c535 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
<?xml version="1.0" encoding="UTF-8"?>
<document>
    <properties>
       <title>Tuscany</title>
       <bannertitle>Welcome to Tuscany</bannertitle>
       <tab>das</tab>
    </properties>
    <body>
    
   <section name="Tuscany DAS - Java">
      <p>This document proves a high-level overview of the Java DAS (Data Access Services) subproject of the Apache Tuscany incubator project.</p>
   </section>


   <section name="DAS Java Getting Started">
      <p>To get started with Java DAS, follow the <a href="downloads.html">downloads</a> link and pick up either a binary or source distribution.
      If you are working from a source distribution, you can follow the <a href="java-projects.html">general instructions</a> for building the whole of the Tuscany java projects,
      or you can follow the intructions within the <A href="java_das_overview.html"> DAS Java overview </A> to build and explore just DAS java.
      </p>

      <h3>General DAS Documentation</h3>
      <table class="bodyTable">
         <tr class="b">
            <td>
               <span style="font-weight: bold;">Title</span>
            </td>
            <td>
               <span style="font-weight: bold;">Description</span>
            </td>
         </tr>
         
         <tr class="b">
            <td>
               <a href='RDB_DAS_white_paper_v-0.2.pdf' target='_blank'>DAS White Paper: The Data Access Service</a>
            </td>
            <td>
               How to access relational data in terms of Service Data Objects
            </td>
         </tr>
         
         <tr class="b">
            <td>
               <a class="external" rel="nofollow" href='http://java.sys-con.com/read/260053.htm'>JDJ DAS Article</a>
            </td>
            <td>
               How to access relational data in terms of Service Data Objects
            </td>
         </tr>	            
      </table>	    
   </section>


   <section name="DAS Java Overview">

      <p>Currently, the project's code base includes an implementation of a DAS RDB (relational database) with following key features :</p>

      <h3>DAS Java Project Structure</h3>

      <p>The DAS RDB project is divided into three parts:</p>
      <ol type="1">
	<li><p><strong>das.rdb</strong> contains the DAS interfaces and  the RDB (Relational Database) runtime implementation.</p></li>
	<li><p><strong>samples.das</strong> provides sample applications based on DAS.</p></li>
	<li><p><strong>distribution.das</strong> provides DAS binaries distribution with required dependencies.</p></li>
	<li><p><strong>distribution.das-samples</strong> provides DAS samples distribution as a ready-to-deploy war file.</p></li>
      </ol>

      
      <h3>DAS high level class diagram</h3>

      <img src ="images/das_class_diagram.jpg" alt="DAS High level class diagram" align="middle" border="0" height="561" width="710"/>

   </section>
   
   <section name="Build Environment Setup">

      <h3>Tuscany Build Environment Setup</h3>

      <p>DAS is a subproject of the Tuscany project. If you check out and
      build the whole Tuscany Java project, you will have also built the DAS
      subproject. If you want to work with the DAS project, without the rest
      of Tuscany, skip to the next section.</p>
      
      <p>To build the whole Tuscany project follow <a class="external" rel="nofollow" href="java-projects.html">these instructions</a>.</p>



      <h3>DAS Java Build Environment Setup</h3>

      <p>If you want to work with the DAS project alone, without the rest of Tuscany, proceed with the following steps.</p>
      <ol type="1">
         <li><p>Set up your environment using the <a class="external" rel="nofollow" href="java-projects.html"> instructions for building the whole of Tuscany</a>,
	     <strong>but</strong> only download and install Java 5, Maven and Svn</p></li>

	<li><p>Make sure 'mvn' and 'svn' commands are in your PATH environment variable.</p></li>

	<li><p>Check out the DAS open source projects from Apache.</p></li>

	<ul>
		<li style="list-style-type: none;">
		<p>Commands:</p>
		<p>md &lt;local tuscany dir&gt; <br/>
		cd &lt;local tuscany dir&gt; <br/>
		svn co <a rel="nofollow" href="https://svn.apache.org/repos/asf/incubator/tuscany/java">https://svn.apache.org/repos/asf/incubator/tuscany/java</a> <br/>
		</p>
		</li>
	</ul>
	</ol>

	<ol start="4" type="1">
		<li><p>Run "mvn" under &lt;local tuscany dir&gt;/java directory to install
		POM files from the root project to the local repository</p></li>
	</ol>
	<ul>
		<li style="list-style-type: none;">
		<p>Commands:</p>
		<ul>
			<li style="list-style-type: none;">
			<p>cd &lt;local tuscany dir&gt;/java/das <br/>
			mvn<br/>
			</p>
			</li>
		</ul>
		</li>
	</ul>
	
	<ul>
		<li style="list-style-type: none;">
		<p><strong>Notes:</strong></p>
		<ol type="1">
			<li><p>If the mvn command completed successfully, you will see BUILD
			SUCCESSFUL in the output and tuscany-das-rdb-1.0-SNAPSHOP.jar is created under
			&lt;local tuscany dir&gt;/java/das/rdb/target directory.</p></li>
			
			<li><p>External resources are at times unavailable. It may be necessary to
			run "mvn" again at a later time.</p></li>

			<li><p>If you are taking time to reply to firewall prompts, this can cause
			some requests to time out. Set up the firewall to permit the action without prompting.</p></li>
		</ol>
		</li>
	</ul>
	
	<H3>Building Javadoc for DAS</H3>

    <p> In order to build DAS Javadocs, you will need to build the a specific maven profile called "javadoc" </p>

	<ul>
		<li style="list-style-type: none;">
		<p>Commands:</p>
		<ul>
			<li style="list-style-type: none;">
			<p>cd &lt;local tuscany dir&gt;/java/das <br/>
			mvn -P javadoc<br/>
			</p>
			</li>
		</ul>
		<p>Note: Javadoc will be available at &lt;local tuscany dir&gt;/java/das/rdb/target/apidocs/index.html.</p>
		</li>
	</ul>

	
	<H3 >Dependency Jars</H3>
	
	<p> The DAS.RDB project has a dependency on SDO and requires the following SDO runtime jars to build</p>
	
	<ul>
	   <li><p>sdo-api-r2.0.1-1.0-SNAPSHOT.jar - SDO 2.0 Interfaces</p></li>
	   <li><p>tuscany-sdo-impl-1.0-SNAPSHOT.jar - SDO 2.0 implementation</p></li>
	</ul>
	
	
	<p>The SDO.IMPL project have dependencies on the following EMF (Eclipse Modeling
	Framework - www.eclipse.org/emf) runtime jars to build:</p>
	<ul>
		<li><p>common-2.2.1.jar - some common framework utility and base classes</p></li>
		<li><p>ecore-2.2.1.jar - the EMF core runtime implementation classes (the Ecore metamodel)</p></li>
		<li><p>ecore-change-2.2.1.jar - the EMF change recorder and framework</p></li>
		<li><p>ecore-xmi-2.2.1.jar - EMF's default XML (and XMI) serializer and loader</p></li>
		<li><p>xsd-2.2.1.jar - the XML Schema model</p></li>
		<li><p>log4j-1.2.12.jar - log4j logging framework</p></li>
	</ul>
	
   </section>


   <section name="Running DAS Samples">

      <p>DAS provide sample a CompanyWeb scenario where it exposes some of the DAS Features integrated in a J2EE webapp.</p>
      <p>Follow the steps below to be able to run the samples in a J2EE webserver (in our case Apache Tomcat)</p>
      
      <p><strong>From the source repository</strong></p>
      
      <ul>
         <li><p>checkout DAS Sample from SVN repository:</p></li>
         <ul>
            <li><p>md 'local tuscany dir'</p></li>
            <li><p>cd 'local tuscany dir'</p></li>
            <li><p>svn co https://svn.apache.org/repos/asf/incubator/tuscany/java/das das</p></li>
         </ul>
         <li><p>use maven to build the CompanyWeb war file:</p></li>
         <ul>
            <li><p>cd das\samples</p></li>
            <li><p>mvn</p></li>
         </ul>
         <li><p>use maven to deploy the CompanyWeb war file to Tomcat</p></li>
         <ul>
            <li><p>mvn tomcat:deploy</p></li>
         </ul>
      </ul>

      <p>There are also some sample applications that use a mix of SCA, SDO and DAS.  See "Running the Samples" on the <a href="java-projects.html#Running the Samples">Java project page</a> for details.</p>
      
      <p><strong>From a DAS Sample distribution (starting with M2)</strong>:</p>
      
      <ul>
         <li><p>Download a das-sample distribution from http://incubator.apache.org/tuscany/downloads.html</p></li>
         <li><p>Extract the companyweb war file</p></li>
         <li><p>Follow regular deployment procedures to deploy the war file</p></li>
      </ul>
   </section>

   <section name="Running Tuscany DAS Unit Tests">
      <p>DAS is currently providing two sets of unit tests</p>
      <ul>
         <li><p>JUnit tests for the core DAS code</p></li>
         <li><p>HTMLUnit tests integrated with Tomcat for DAS CompanyWeb sample application</p></li>
      </ul>
      <p>Below we are going to describe how you can exercise these two sets of tests, and we recommend you running them after contributing code/patches for DAS 
      to validate that your new changes are not introducing any regressions.</p>
      
      <p><strong>Running DAS tests as part of the build</strong></p>
      <ul>
         <li><p>cd 'local tuscany dir'/java/das</p></li>
         <li><p>mvn test</p></li>
         
         <p>
		-------------------------------------------------------<br/>
		 T E S T S<br/>
		-------------------------------------------------------<br/>
		Running org.apache.tuscany.das.rdb.test.suites.AllTestsDerby<br/>
		Setting up for Derby run<br/>
		Ending Derby run<br/>
		Tests run: 137, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 33.468 sec<br/>
                <br/>
		Results :<br/>
                <br/>
		Tests run: 137, Failures: 0, Errors: 0, Skipped: 0<br/>
                <br/>
		[INFO] ------------------------------------------------------------------------<br/>
		[INFO] BUILD SUCCESSFUL<br/>
		[INFO] ------------------------------------------------------------------------<br/>
		[INFO] Total time: 57 seconds<br/>
		[INFO] Finished at: Tue Oct 03 12:06:13 PDT 2006<br/>
		[INFO] Final Memory: 5M/10M<br/>
		[INFO] ------------------------------------------------------------------------<br/>
		<br/>
         </p>
      </ul>
      
      <p><strong>Running DAS CompanyWeb tests in tomcat</strong></p>
      <ul>
         <li><p>Download tomcat distribution into your local filesystem : http://tomcat.apache.org/</p></li>
         <li><p>Create a build.properties in your root directory (e.g. C:\Documents and Settings\lresende in Win2K systems) with the following contents</p></li>
         <ul>
            <li><p>tuscany.acceptance.tomcat.zipped='directory where tomcat was downloaded'\\apache-tomcat-5.5.17-tuscany.zip</p></li>
         </ul>
         <li><p>checkout DAS Sample from SVN repository:</p></li>
         <ul>
            <li><p>md 'local tuscany dir'</p></li>
            <li><p>cd 'local tuscany dir'</p></li>
            <li><p>svn co https://svn.apache.org/repos/asf/incubator/tuscany/java/das das</p></li>
         </ul>
         <li><p>use maven run the DAS CompanyWeb tests in Tomcat:</p></li>
         <ul>
	    <li><p>cd das/samples/testing/tomcat</p></li>
            <li><p>mvn</p></li>
            <p>
		-------------------------------------------------------<br/>
		 T E S T S<br/>
		-------------------------------------------------------<br/>
		Running org.apache.tuscany.test.das.DasTestCase<br/>
		Running:HomePage                        SUCCESS!!!<br/>
		Running:AllCompanies                    SUCCESS!!!<br/>
		Running:AllCompaniesDepartments         SUCCESS!!!<br/>
		Running:AddDepartmentToFirstCompany     SUCCESS!!!<br/>
		Running:ChangeCompanyDepartmentNames    SUCCESS!!!<br/>
		Running:DeleteCompanyOneDepartments     SUCCESS!!!<br/>
		Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.911 sec<br/>
                <br/>
		Results :<br/>
                <br/>
		Tests run: 6, Failures: 0, Errors: 0, Skipped: 0<br/>
                <br/>
		[INFO]<br/>
		[INFO]<br/>
		[INFO] ------------------------------------------------------------------------<br/>
		[INFO] Reactor Summary:<br/>
		[INFO] ------------------------------------------------------------------------<br/>
		[INFO] Tuscany Testing in Tomcat ............................. SUCCESS [0.251s]<br/>
		[INFO] Tuscany Testing DAS Sample - Companyweb ............... SUCCESS [1:17.791s]<br/>
		[INFO] ------------------------------------------------------------------------<br/>
		[INFO] ------------------------------------------------------------------------<br/>
		[INFO] BUILD SUCCESSFUL<br/>
		[INFO] ------------------------------------------------------------------------<br/>
		[INFO] Total time: 1 minute 18 seconds<br/>
		[INFO] Finished at: Tue Oct 03 12:25:48 PDT 2006<br/>
		[INFO] Final Memory: 7M/15M<br/>
		[INFO] ------------------------------------------------------------------------<br/>
            </p>
            <li><p><strong>Note: Due to a current limitation, you must run mvn clean before you can run the tests a second time</strong></p></li>
         </ul>
      </ul>
   </section>


  </body>
</document>