Java Doc for SDEJavaApiJoinTest.java in  » GIS » GeoTools-2.4.1 » org » geotools » arcsde » data » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.arcsde.data 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.geotools.arcsde.data.SDEJavaApiJoinTest

SDEJavaApiJoinTest
public class SDEJavaApiJoinTest extends TestCase (Code)
ArcSDEDAtaStore test case for a master-child joining

This test will create an sde layer (table + spatial table) as master and a business table as child:


 -----------------------------------------------
 |            GT_SDE_TEST_MASTER               |
 -----------------------------------------------
 |  ID(int)  | NAME (string)  | SHAPE (Point)  |
 -----------------------------------------------
 |     1     |   name1        |  POINT(1, 1)   |
 -----------------------------------------------
 |     2     |   name2        |  POINT(2, 2)   |
 -----------------------------------------------
 |     3     |   name3        |  POINT(3, 3)   |
 -----------------------------------------------
 ---------------------------------------------------------------------
 |                     GT_SDE_TEST_CHILD                             |
 ---------------------------------------------------------------------
 | ID(int)   | MASTER_ID      | NAME (string)  | DESCRIPTION(string  |
 ---------------------------------------------------------------------
 |    1      |      1         |   child1       |    description1     |
 ---------------------------------------------------------------------
 |    2      |      2         |   child2       |    description2     |
 ---------------------------------------------------------------------
 |    3      |      2         |   child3       |    description3     |
 ---------------------------------------------------------------------
 |    4      |      3         |   child4       |    description4     |
 ---------------------------------------------------------------------
 |    5      |      3         |   child5       |    description5     |
 ---------------------------------------------------------------------
 |    6      |      3         |   child6       |    description6     |
 ---------------------------------------------------------------------
 
 </re>
 

The following are rules that may help you in correctly specifying an SQL query that will work with the ArcSDE Java API. This rules was collected empirically based on some of the tests of this test suite. Be aware that ArcSDE Java API only supports "queries" of the following form: SELECT <list of qualified column names> FROM <list of qualified table names> WHERE <any where clause supported by the RDBMS> [ORDER BY <qualified column names>] Rules to create SQL QUERIES:

  • Use full qualified table names. Queries that usually would work against the underlying RDBMS will not work through the ArcSDE Java API if you do not fully qualify table names.
  • Do not use table aliases, or SHAPE field is fetched as int instead of as geometry.
  • Specifying a GROUP BY clause seems incompatible with using the SHAPE field. If you specify a GROUP BY clause, ArcSDE will return the plain SHAPE field (int) instead of a geometry.
  • And the <strong>most important</strong> one: <strong>SET THE SPATIAL COLUMN AS THE LAST ONE</strong>. This is most likely a bug in the ArcSDE Java API, since if you do not set the shape field as the last one in the select items list an IndexOutOfBoundsException is thrown by SeRow.fetch()


author:
   Gabriel Roldan, Axios Engineering
version:
   $Id: SDEJavaApiJoinTest.java 27863 2007-11-12 20:34:34Z desruisseaux $
since:
   2.3.x




Method Summary
public static  voidoneTimeSetUp()
    
public static  voidoneTimeTearDown()
    
protected  voidsetUp()
    
public static  Testsuite()
    
protected  voidtearDown()
    
public  voidtestApiAlias()
     Using table alias leads to ArcSDE returning SHAPE id instead of SHAPE geometry.
public  voidtestApiGroupBy()
    
public  voidtestApiOrderBy()
    
public  voidtestApiPlainSql()
     Meant as example to be sure we're using the ArcSDE java api correctly.
public  voidtestQueryView()
    
public  voidtestReadView()
    
public  voidtestRegisterDuplicateViewName()
    
public  voidtestRegisterIllegalView()
    
public  voidtestRegisterViewBuildsCorrectFeatureType()
    
public  voidtestRegisterViewListedInGetTypeNames()
    
public  voidtestViewBounds()
    
public  voidtestViewBoundsQuery()
    
public  voidtestViewCount()
    
public  voidtestViewCountQuery()
    



Method Detail
oneTimeSetUp
public static void oneTimeSetUp() throws IOException, SeException, NoSuchAuthorityCodeException, FactoryException(Code)
Initialization code for the whole test suite
throws:
  IOException -
throws:
  SeException -
throws:
  FactoryException -
throws:
  NoSuchAuthorityCodeException -



oneTimeTearDown
public static void oneTimeTearDown()(Code)
Tear down code for the whole suite



setUp
protected void setUp() throws Exception(Code)
loads testData/testparams.properties into a Properties object, wich is used to obtain test tables names and is used as parameter to find the DataStore
throws:
  Exception - DOCUMENT ME!



suite
public static Test suite()(Code)
Builds a test suite for all this class' tests with per suite initialization directed to SDEJavaApiJoinTest.oneTimeSetUp() and per suite clean up directed to SDEJavaApiJoinTest.oneTimeTearDown()



tearDown
protected void tearDown() throws Exception(Code)
DOCUMENT ME!
throws:
  Exception - DOCUMENT ME!



testApiAlias
public void testApiAlias() throws Exception(Code)
Using table alias leads to ArcSDE returning SHAPE id instead of SHAPE geometry.
throws:
  Exception -



testApiGroupBy
public void testApiGroupBy() throws Exception(Code)
Meant as example to be sure we're using the ArcSDE java api correctly Nasty thing about group by is that is seems that we cannot include/use the geometry column :(
throws:
  Exception -



testApiOrderBy
public void testApiOrderBy() throws Exception(Code)
Meant as example to be sure we're using the ArcSDE java api correctly
throws:
  Exception -



testApiPlainSql
public void testApiPlainSql() throws Exception(Code)
Meant as example to be sure we're using the ArcSDE java api correctly. We can execute a plain sql query, but shapes are not returned by ArcSDE. Instead, the SHAPE field contains the SHAPE id, just like in the real business table.
throws:
  Exception -



testQueryView
public void testQueryView() throws Exception(Code)



testReadView
public void testReadView() throws Exception(Code)



testRegisterDuplicateViewName
public void testRegisterDuplicateViewName() throws IOException(Code)
Fail if tried to register the same view name more than once



testRegisterIllegalView
public void testRegisterIllegalView() throws IOException(Code)
Assert that the datastore complains on views with non supported features



testRegisterViewBuildsCorrectFeatureType
public void testRegisterViewBuildsCorrectFeatureType() throws IOException(Code)



testRegisterViewListedInGetTypeNames
public void testRegisterViewListedInGetTypeNames() throws IOException(Code)



testViewBounds
public void testViewBounds() throws IOException(Code)



testViewBoundsQuery
public void testViewBoundsQuery() throws Exception(Code)



testViewCount
public void testViewCount() throws Exception(Code)



testViewCountQuery
public void testViewCountQuery() throws Exception(Code)



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.